Lines Matching refs:Timer
40 def wrap_timer(self, timer):
41 """Records 'timer' and returns self as callable timer."""
42 self.saved_timer = timer
74 self.assertRaises(ValueError, timeit.Timer, stmt=None)
75 self.assertRaises(SyntaxError, timeit.Timer, stmt='return')
76 self.assertRaises(SyntaxError, timeit.Timer, stmt='yield')
77 self.assertRaises(SyntaxError, timeit.Timer, stmt='yield from ()')
78 self.assertRaises(SyntaxError, timeit.Timer, stmt='break')
79 self.assertRaises(SyntaxError, timeit.Timer, stmt='continue')
80 self.assertRaises(SyntaxError, timeit.Timer, stmt='from timeit import *')
83 self.assertRaises(ValueError, timeit.Timer, setup=None)
84 self.assertRaises(SyntaxError, timeit.Timer, setup='return')
85 self.assertRaises(SyntaxError, timeit.Timer, setup='yield')
86 self.assertRaises(SyntaxError, timeit.Timer, setup='yield from ()')
87 self.assertRaises(SyntaxError, timeit.Timer, setup='break')
88 self.assertRaises(SyntaxError, timeit.Timer, setup='continue')
89 self.assertRaises(SyntaxError, timeit.Timer, setup='from timeit import *')
102 t = timeit.Timer(stmt=stmt, setup=setup, timer=self.fake_timer,
137 # timer=FakeTimer())
142 timer=FakeTimer())
148 t = timeit.Timer(stmt='_global_timer.inc()', timer=_global_timer)
150 timeit.timeit(stmt='_global_timer.inc()', timer=_global_timer,
153 timeit.timeit(stmt='local_timer.inc()', timer=local_timer,
158 t = timeit.Timer(stmt=stmt, setup=setup, timer=self.fake_timer)
201 # timer=FakeTimer())
206 timer=FakeTimer())
211 timer=FakeTimer())
222 t = timeit.Timer("1/0")
231 def run_main(self, seconds_per_increment=1.0, switches=None, timer=None):
232 if timer is None:
233 timer = FakeTimer(seconds_per_increment=seconds_per_increment)
242 timeit.main(args=args, _wrap_timer=timer.wrap_timer)
298 s = self.run_main(switches=['-t'], timer=fake_timer)
304 s = self.run_main(switches=['-c'], timer=fake_timer)
358 timer = FakeTimer(seconds_per_increment=0.001)
359 t = timeit.Timer(stmt=self.fake_stmt, setup=self.fake_setup, timer=timer)