GeezerVison is showing github.com — gh-115637 clarify that time.perf_counter cannot go backwards by anarcat · Pull Request #115638 · python/cpython
Conversation
anarcat
commented
Feb 18, 2024
•
edited by github-actions
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
I'm not completely sure about this, but it seems to me this counter is also designed to avoid jumping backwards on (say) daylight saving or clock changes. It's kind of hinted to in the current description, but reading PEP 418 it's very clear that it's part of the intention, as it falls back to time.monotonic() apart from on nt.
📚 Documentation preview 📚: https://cpython-previews--115638.org.readthedocs.build/
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
ghost
commented
Feb 18, 2024
•
edited by ghost
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
All commit authors signed the Contributor License Agreement. 
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
I'm not completely sure about this, but it seems to me this counter is *also* designed to avoid jumping backwards on (say) daylight saving or clock changes. It's kind of hinted to in the current description, but reading PEP 418 it's very clear that it's part of the intention, as it falls back to time.monotonic() apart from on `nt`.
|
@arnarcat Thanks for the draft PR. Given your discussion with @vstinner on the issue, do you want to move this out of draft or close the PR?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
i'm not sure. i guess i'm waiting on other folks to weigh in on the issue first...
|
willingc reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
See also issue gh-88494.
I created PR gh-116781 to use QueryPerformanceCounter() for time.monotonic().
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
This PR is stale because it has been open for 30 days with no activity.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
|
|
|
.. impl-detail::
|
|
|
|
|
|
On CPython, use the same clock as :func:`time.monotonic` and is a
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but that's different from the patch I was suggesting though. below is an "implementation detail" and above is more of a specification...
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Closing as per note on issue.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
pganssle
Awaiting requested review from pganssle
pganssle is a code owner
abalkin
Awaiting requested review from abalkin
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|