Home | History | Annotate | Download | only in test

Lines Matching refs:Timer

39     def wrap_timer(self, timer):
40 """Records 'timer' and returns self as callable timer."""
41 self.saved_timer = timer
73 self.assertRaises(ValueError, timeit.Timer, stmt=None)
74 self.assertRaises(SyntaxError, timeit.Timer, stmt='return')
75 self.assertRaises(SyntaxError, timeit.Timer, stmt='yield')
76 self.assertRaises(SyntaxError, timeit.Timer, stmt='yield from ()')
77 self.assertRaises(SyntaxError, timeit.Timer, stmt='break')
78 self.assertRaises(SyntaxError, timeit.Timer, stmt='continue')
79 self.assertRaises(SyntaxError, timeit.Timer, stmt='from timeit import *')
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='yield from ()')
86 self.assertRaises(SyntaxError, timeit.Timer, setup='break')
87 self.assertRaises(SyntaxError, timeit.Timer, setup='continue')
88 self.assertRaises(SyntaxError, timeit.Timer, setup='from timeit import *')
101 t = timeit.Timer(stmt=stmt, setup=setup, timer=self.fake_timer,
136 # timer=FakeTimer())
141 timer=FakeTimer())
147 t = timeit.Timer(stmt='_global_timer.inc()', timer=_global_timer)
149 timeit.timeit(stmt='_global_timer.inc()', timer=_global_timer,
152 timeit.timeit(stmt='local_timer.inc()', timer=local_timer,
157 t = timeit.Timer(stmt=stmt, setup=setup, timer=self.fake_timer)
200 # timer=FakeTimer())
205 timer=FakeTimer())
210 timer=FakeTimer())
221 t = timeit.Timer("1/0")
230 def run_main(self, seconds_per_increment=1.0, switches=None, timer=None):
231 if timer is None:
232 timer = FakeTimer(seconds_per_increment=seconds_per_increment)
241 timeit.main(args=args, _wrap_timer=timer.wrap_timer)
358 timer = FakeTimer(seconds_per_increment=seconds_per_increment)
359 t = timeit.Timer(stmt=self.fake_stmt, setup=self.fake_setup, timer=timer)