Lines Matching refs:Timer
9 Library usage: see the Timer class.
16 -r/--repeat N: how many times to repeat the timer (default 5)
41 Timer
56 __all__ = ["Timer", "timeit", "repeat", "default_timer"]
66 # in Timer.__init__() depend on setup being indented 4 spaces and stmt
82 class Timer:
86 statement used for setup, and a timer function. Both statements
87 default to 'pass'; the timer function is platform-dependent (see
100 def __init__(self, stmt="pass", setup="pass", timer=default_timer,
103 self.timer = timer
140 t = Timer(...) # outside the try/except
170 the timer function to be used are passed to the constructor.
176 timing = self.inner(it, self.timer)
188 the second argument specifies the timer argument, defaulting
229 def timeit(stmt="pass", setup="pass", timer=default_timer,
231 """Convenience function to create Timer object and call timeit method."""
232 return Timer(stmt, setup, timer, globals).timeit(number)
234 def repeat(stmt="pass", setup="pass", timer=default_timer,
236 """Convenience function to create Timer object and call repeat method."""
237 return Timer(stmt, setup, timer, globals).repeat(repeat, number)
253 is not None, it must be a callable that accepts a timer function
254 and returns another timer function (used for unit testing).
269 timer = default_timer
295 timer = time.process_time
311 timer = _wrap_timer(timer)
313 t = Timer(stmt, setup, timer)