示例#1
0
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)
示例#2
0
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)