Home | History | Annotate | Download | only in Lib

Lines Matching refs:Timer

9 Library usage: see the Timer class.
16 -r/--repeat N: how many times to repeat the timer (default 3)
33 The difference in default timer function is because on Windows,
36 time() is much more precise. On either platform, the default timer
64 __all__ = ["Timer"]
71 # On Windows, the best timer is time.clock()
74 # On most other platforms the best timer is time.time()
78 # in Timer.__init__() depend on setup being indented 4 spaces and stmt
95 """Create a timer function. Used if the "statement" is a callable."""
105 class Timer:
109 statement used for setup, and a timer function. Both statements
110 default to 'pass'; the timer function is platform-dependent (see
121 def __init__(self, stmt="pass", setup="pass", timer=default_timer):
123 self.timer = timer
163 t = Timer(...) # outside the try/except
193 the timer function to be used are passed to the constructor.
202 timing = self.inner(it, self.timer)
214 the second argument specifies the timer argument, defaulting
234 def timeit(stmt="pass", setup="pass", timer=default_timer,
236 """Convenience function to create Timer object and call timeit method."""
237 return Timer(stmt, setup, timer).timeit(number)
239 def repeat(stmt="pass", setup="pass", timer=default_timer,
241 """Convenience function to create Timer object and call repeat method."""
242 return Timer(stmt, setup, timer).repeat(repeat, number)
258 is not None, it must be a callable that accepts a timer function
259 and returns another timer function (used for unit testing).
272 timer = default_timer
289 timer = time.time
291 timer = time.clock
306 timer = _wrap_timer(timer)
307 t = Timer(stmt, setup, timer)