class SleepingMapper(TMapper): def __init__(self, ctx): super(SleepingMapper, self).__init__(ctx) self.timer = Timer(ctx) def map(self, ctx): with self.timer.time_block("sleep"): time.sleep(.001) super(SleepingMapper, self).map(ctx)
class SleepingMapper(TMapper): def __init__(self, ctx): super(SleepingMapper, self).__init__(ctx) self.timer = Timer(ctx) def map(self, ctx): with self.timer.time_block("sleep"): time.sleep(0.001) super(SleepingMapper, self).map(ctx)