def testTimingContext(self): with timing.Timer('busywait', self.logger): timing.busywait(100) with timing.Timer('defaultlog'): timing.busywait(100)
def testTiming(self): timer = timing.Timer('busywait', self.logger) timer.start() timing.busywait(1000) timer.stop() self.logger.info('plain timing took %s seconds', timer.dt)
def testTimingContext(self): with timing.Timer('busywait', self.logger.info): timing.busywait(1000)