Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Aug 27, 2023
Prev Previous commit
Next Next commit
Update timeit.rst
  • Loading branch information
terryjreedy authored Aug 27, 2023
commit aae5a3540fe8f59bdea8a4c0b4732f9ef3a24477
6 changes: 3 additions & 3 deletions Doc/library/timeit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ A callable can also be passed from the :ref:`python-interface`::
Note however that :func:`.timeit` will automatically determine the number of
repetitions only when the command-line interface is used. In the
:ref:`timeit-examples` section you can find more advanced examples.
Especially, the time unit can be changed by modifying :func:`default_timer`
or passing other timer in function.


.. _python-interface:
Expand Down Expand Up @@ -88,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.
Expand Down