PyDocs

Nav

Debugging and profiling

Timer.autorange

timeit

method of Timer · Added in 3.6 (source)
  • Timer.autorange(callback=None, target_time=None)
Return the number of loops and time taken so that
total time >= target_time (default is 0.2 seconds).

Calls the timeit method with increasing numbers from the sequence
1, 2, 5, 10, 20, 50, ... until the target time is reached.
Returns (number, time_taken).

If *callback* is given and is not None, it will be called after
each trial with two arguments: ``callback(number, time_taken)``.
Changed in 3.15
  • 3.15: The optional target_time parameter was added.
0 Examples
No examples for timeit/Timer.autorange.
See Also
No see-alsos for timeit/Timer.autorange
0 Notes
No notes for Timer.autorange