Home | History | Annotate | Download | only in python2.7

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
156 t = Timer(...) # outside the try/except
186 the timer function to be used are passed to the constructor.
195 timing = self.inner(it, self.timer)
207 the second argument specifies the timer argument, defaulting
227 def timeit(stmt="pass", setup="pass", timer=default_timer,
229 """Convenience function to create Timer object and call timeit method."""
230 return Timer(stmt, setup, timer).timeit(number)
232 def repeat(stmt="pass", setup="pass", timer=default_timer,
234 """Convenience function to create Timer object and call repeat method."""
235 return Timer(stmt, setup, timer).repeat(repeat, number)
261 timer = default_timer
278 timer = time.time
280 timer = time.clock
294 t = Timer(stmt, setup, timer)