mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
gh-105052:update timeit function's description (#105060)
--------- Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
This commit is contained in:
parent
1ac64237e6
commit
7096a2be33
3 changed files with 17 additions and 8 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue