Skip to content

gh-115637 clarify that time.perf_counter cannot go backwards #115638

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Doc/library/time.rst
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,8 @@ Functions
clock with the highest available resolution to measure a short duration. It
does include time elapsed during sleep and is system-wide. The reference
point of the returned value is undefined, so that only the difference between
the results of two calls is valid.
the results of two calls is valid. This counter, like :func:`monotonic`, cannot
go backwards.

Use :func:`perf_counter_ns` to avoid the precision loss caused by the
:class:`float` type.
Expand Down