Skip to content

Commit fccebd0

Browse files
scopbrijkapadia
andcommitted
docs: improve timeit autorange description
It not only determines but actually runs timeit a number of times. Also be more concise; the original form said basically the same thing twice. Co-authored-by: bkap123 <97006829+bkap123@users.noreply.github.com>
1 parent b2582a6 commit fccebd0

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Doc/library/timeit.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,13 @@ The module defines three convenience functions and a public class:
145145

146146
.. method:: Timer.autorange(callback=None, target_time=None)
147147

148-
Automatically determine how many times to call :meth:`.timeit`.
148+
Call :meth:`.timeit` an automatically determined number of times.
149149

150-
This is a convenience function that calls :meth:`.timeit` repeatedly
151-
so that the total time >= *Timer.target_time* seconds, returning the eventual
152-
(number of loops, time taken for that number of loops). It calls
153-
:meth:`.timeit` with increasing numbers from the sequence 1, 2, 5,
154-
10, 20, 50, ... until the time taken is at least *target_time* seconds.
150+
This is a convenience function that repeatedly calls :meth:`.timeit`
151+
with an increasing amount of iterations from the sequence 1, 2, 5, 10,
152+
20, 50, ... until the time taken is at least *target_time* seconds,
153+
returning the eventual (number of loops, time taken for that number of
154+
loops).
155155

156156
If *callback* is given and is not ``None``, it will be called after
157157
each trial with two arguments: ``callback(number, time_taken)``.

0 commit comments

Comments
 (0)