diff -r 40e97c9dae7a Doc/library/timeit.rst --- a/Doc/library/timeit.rst Tue Oct 18 17:55:18 2016 +0200 +++ b/Doc/library/timeit.rst Tue Oct 18 18:09:12 2016 +0200 @@ -141,8 +141,8 @@ The module defines three convenience fun This is a convenience function that calls :meth:`.timeit` repeatedly so that the total time >= 0.2 second, returning the eventual (number of loops, time taken for that number of loops). It calls - :meth:`.timeit` with *number* set to successive powers of ten (10, - 100, 1000, ...) up to a maximum of one billion, until the time taken + :meth:`.timeit` with *number* set to successive powers of two + (1, 2, 4, 8, ...) up to a maximum of ``2**30``, until the time taken is at least 0.2 second, or the maximum is reached. If *callback* is given and is not *None*, it will be called after diff -r 40e97c9dae7a Lib/timeit.py --- a/Lib/timeit.py Tue Oct 18 17:55:18 2016 +0200 +++ b/Lib/timeit.py Tue Oct 18 18:09:12 2016 +0200 @@ -209,15 +209,15 @@ class Timer: """Return the number of loops so that total time >= 0.2. Calls the timeit method with *number* set to successive powers of - ten (10, 100, 1000, ...) up to a maximum of one billion, until + two (1, 2, 4, 8, ...) up to a maximum of 2**30, until the time taken is at least 0.2 second, or the maximum 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)``. """ - for i in range(0, 10): - number = 10**i + for i in range(0, 31): + number = 2 ** i time_taken = self.timeit(number) if callback: callback(number, time_taken)