GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-115637 clarify that time.perf_counter cannot go backwards by anarcat · Pull Request #115638 · python/cpython

Conversation

@anarcat

@anarcat anarcat commented Feb 18, 2024 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

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.

  • Issue: time.perf_counter() should state more clearly (or deny) that it is monotonic #115637

📚 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.

All reactions
@anarcat
anarcat requested review from abalkin and pganssle as code owners February 18, 2024 21:32
@ghost

ghost commented Feb 18, 2024 •
edited by ghost
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.
CLA signed

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added awaiting review docs Documentation in the Doc dir skip news labels Feb 18, 2024
@bedevere-app bedevere-app Bot mentioned this pull request Feb 18, 2024
time.perf_counter() should state more clearly (or deny) that it is monotonic #115637
Closed
@anarcat
clarify that time.perf_counter cannot go backwards
03a0708
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`.
@anarcat
anarcat force-pushed the patch-1 branch from 8c2d2e4 to 03a0708 Compare February 18, 2024 21:37
@anarcat
anarcat marked this pull request as draft February 19, 2024 14:31
@bedevere-app bedevere-app Bot removed the awaiting review label Feb 19, 2024
@willingc

willingc commented Feb 23, 2024

Copy link
Copy Markdown
Contributor

@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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@anarcat

anarcat commented Feb 24, 2024

Copy link
Copy Markdown
Author

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
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Mar 14, 2024

Copy link
Copy Markdown
Member

See also issue gh-88494.

I created PR gh-116781 to use QueryPerformanceCounter() for time.monotonic().

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner vstinner mentioned this pull request Mar 14, 2024
gh-88494: Use QueryPerformanceCounter() for time.monotonic() #116781
Merged
@github-actions

github-actions Bot commented Apr 15, 2026

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 15, 2026
@anarcat
anarcat marked this pull request as ready for review April 15, 2026 13:14
@anarcat
anarcat requested a review from StanFromIreland as a code owner April 15, 2026 13:14
@bedevere-app bedevere-app Bot added the awaiting review label Apr 15, 2026
@StanFromIreland
Merge branch 'main' into patch-1
66e9aa4
@github-actions github-actions Bot removed the stale Stale PR or inactive for long period of time. label May 12, 2026
StanFromIreland
StanFromIreland reviewed Jun 5, 2026
View reviewed changes
Comment thread Doc/library/time.rst

.. impl-detail::

On CPython, use the same clock as :func:`time.monotonic` and is a

@StanFromIreland StanFromIreland Jun 5, 2026

Copy link
Copy Markdown
Member

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.

This is documented here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@anarcat anarcat Jun 8, 2026

Copy link
Copy Markdown
Author

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.

All reactions
@StanFromIreland

StanFromIreland commented Jun 5, 2026

Copy link
Copy Markdown
Member

Closing as per note on issue.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@StanFromIreland StanFromIreland closed this Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@StanFromIreland StanFromIreland StanFromIreland left review comments
@pganssle pganssle Awaiting requested review from pganssle pganssle is a code owner
@abalkin abalkin Awaiting requested review from abalkin

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

Docs PRs
Status: Todo

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.

4 participants

@anarcat @willingc @vstinner @StanFromIreland
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.