This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Alex.Willmer
Recipients Alex.Willmer, docs@python
Date 2021-03-04.22:21:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1614896470.36.0.766208602401.issue43407@roundup.psfhosted.org>
In-reply-to
Content
I believe the documentation for time.monotonic() and time.perf_counter() could be misleading. Taken literally they could imply that given

delta = 0.1
a = time.monotonic()
b = time.monotonic()
c = time.monotonic()

the comparisons `b - a < delta`, and `c - b < delta` are valid; but `c - a < delta` is not valid.

I believe that `c - a < delta` is a valid comparison, and that what the documentation means to say is "only the difference between the results of *subsequent* calls is valid."

The exact wording (present since the functions were added in https://hg.python.org/cpython/rev/376ce937823c)

> The reference point of the returned value is undefined, so that only
> the difference between the results of consecutive calls is valid.

If there is agreement I'll submit a PR.
History
Date User Action Args
2021-03-04 22:21:10Alex.Willmersetrecipients: + Alex.Willmer, docs@python
2021-03-04 22:21:10Alex.Willmersetmessageid: <1614896470.36.0.766208602401.issue43407@roundup.psfhosted.org>
2021-03-04 22:21:10Alex.Willmerlinkissue43407 messages
2021-03-04 22:21:10Alex.Willmercreate