Lines Matching refs:Timer
41 def wrap_timer(self, timer):
42 """Records 'timer' and returns self as callable timer."""
43 self.saved_timer = timer
75 self.assertRaises(ValueError, timeit.Timer, stmt=None)
76 self.assertRaises(SyntaxError, timeit.Timer, stmt='return')
77 self.assertRaises(SyntaxError, timeit.Timer, stmt='yield')
78 self.assertRaises(SyntaxError, timeit.Timer, stmt='break')
79 self.assertRaises(SyntaxError, timeit.Timer, stmt='continue')
82 self.assertRaises(ValueError, timeit.Timer, setup=None)
83 self.assertRaises(SyntaxError, timeit.Timer, setup='return')
84 self.assertRaises(SyntaxError, timeit.Timer, setup='yield')
85 self.assertRaises(SyntaxError, timeit.Timer, setup='break')
86 self.assertRaises(SyntaxError, timeit.Timer, setup='continue')
99 t = timeit.Timer(stmt=stmt, setup=setup, timer=self.fake_timer)
133 # timer=FakeTimer())
138 timer=FakeTimer())
143 t = timeit.Timer(stmt=stmt, setup=setup, timer=self.fake_timer)
186 # timer=FakeTimer())
191 timer=FakeTimer())
196 timer=FakeTimer())
207 t = timeit.Timer("1.0/0.0")
216 def run_main(self, seconds_per_increment=1.0, switches=None, timer=None):
217 if timer is None:
218 timer = FakeTimer(seconds_per_increment=seconds_per_increment)
227 timeit.main(args=args, _wrap_timer=timer.wrap_timer)
275 s = self.run_main(switches=['-t'], timer=fake_timer)
281 s = self.run_main(switches=['-c'], timer=fake_timer)