gh-105052:update timeit function's description (#105060)

---------
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
This commit is contained in:
R 2023-08-27 15:22:27 +08:00 committed by GitHub
parent 1ac64237e6
commit 7096a2be33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 8 deletions

View file

@ -86,9 +86,11 @@ The module defines three convenience functions and a public class:
.. versionchanged:: 3.7
Default value of *repeat* changed from 3 to 5.
.. function:: default_timer()
The default timer, which is always :func:`time.perf_counter`.
The default timer, which is always time.perf_counter(), returns float seconds.
An alternative, time.perf_counter_ns, returns integer nanoseconds.
.. versionchanged:: 3.3
:func:`time.perf_counter` is now the default timer.
@ -124,7 +126,7 @@ The module defines three convenience functions and a public class:
Time *number* executions of the main statement. This executes the setup
statement once, and then returns the time it takes to execute the main
statement a number of times, measured in seconds as a float.
statement a number of times. The default timer returns seconds as a float.
The argument is the number of times through the loop, defaulting to one
million. The main statement, the setup statement and the timer function
to be used are passed to the constructor.