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-126745: Fixup Docu time.rst by dbstf · Pull Request #126744 · python/cpython

Conversation

@dbstf

@dbstf dbstf commented Nov 12, 2024 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
  • On Windows, the .time function now uses GetSystemTimePreciseAsFileTime() [--> 1 microsecond resolution] instead of GetSystemTimeAsFileTime() [--> 15.625 millisecond resolution].
  • On Windows The .monotonic functions now use the same clock as the .perf_counter functions, not vice versa. The .perf_counter functions previously already used QueryPerformanceCounter() + QueryPerformanceFrequency() [--> 1 microsecond resolution], whereas the .monotonic functions used GetTickCount64() [--> 15.625 millisecond resolution].

📚 Documentation preview 📚: https://cpython-previews--126744.org.readthedocs.build/

  • Issue: Fix Docu time.rst - GetSystemTimePreciseAsFileTime() and monotonic() clock #126745

Sorry, something went wrong.

Uh oh!

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

All reactions
@dbstf
Fixup Docu time.rst
f1d7dfd
- On Windows, the .time function now uses GetSystemTimePreciseAsFileTime() [--> 1 microsecond resolution] instead of GetSystemTimeAsFileTime() [--> 15.625 millisecond resolution].
- On Windows The .monotonic functions now use the same clock as the .perf_counter functions, not vice versa. The .perf_counter functions previously already used QueryPerformanceCounter() + QueryPerformanceFrequency() [--> 1 microsecond resolution], whereas the .monotonic functions used GetTickCount64() [--> 15.625 millisecond resolution].
@dbstf
dbstf requested review from abalkin and pganssle as code owners November 12, 2024 14:06
@ghost

ghost commented Nov 12, 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 docs Documentation in the Doc dir skip news awaiting review labels Nov 12, 2024
@dbstf
Merge branch 'main' into dbstf-fixup-time-docu
3e82a9d
@dbstf dbstf changed the title Fixup Docu time.rst gh-126745: Fixup Docu time.rst Nov 12, 2024
@bedevere-app bedevere-app Bot mentioned this pull request Nov 12, 2024
Fix Docu time.rst - GetSystemTimePreciseAsFileTime() and monotonic() clock #126745
Closed
@picnixz picnixz added the needs backport to 3.13 only security fixes label Nov 12, 2024
vadmium
vadmium reviewed Nov 17, 2024
View reviewed changes
Comment thread Doc/library/time.rst
.. impl-detail::

On CPython, use the same clock as :func:`time.perf_counter` and is a
monotonic clock, i.e. a clock that cannot go backwards.

@vadmium vadmium Nov 17, 2024

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 makes more sense under perf_counter were it was. All monotonic function should always be monotonic, by definition.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Doc/library/time.rst
On macOS, the function is now system-wide.

.. versionchanged:: 3.13
Use the same clock as :func:`time.perf_counter`. On Windows, :func:`monotonic`

This comment was marked as resolved.

Sign in to view

Sorry, something went wrong.

Uh oh!

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

Comment thread Doc/library/time.rst
Comment on lines +316 to +317
Use the same clock as :func:`time.perf_counter`. On Windows, :func:`monotonic`
now call ``QueryPerformanceCounter()`` which has a resolution of 1 microsecond,

@vadmium vadmium Nov 17, 2024

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.

Suggested change
Use the same clock as :func:`time.perf_counter`. On Windows, :func:`monotonic`
now call ``QueryPerformanceCounter()`` which has a resolution of 1 microsecond,
Use the same clock as :func:`time.perf_counter`. On Windows, :func:`monotonic`
now calls ``QueryPerformanceCounter()`` which has a resolution of 1 microsecond,

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Doc/library/time.rst
Use :func:`time_ns` to avoid the precision loss caused by the :class:`float`
type.

.. versionchanged:: 3.13

@vadmium vadmium Nov 17, 2024

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.

Suggested change
.. versionchanged:: 3.13
.. versionchanged:: 3.13

Suspect the mixed indentation is screwing it up

Sorry, something went wrong.

Uh oh!

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

All reactions
vadmium
vadmium reviewed Nov 17, 2024
View reviewed changes
Comment thread Doc/library/time.rst
On macOS, the function is now system-wide.

.. versionchanged:: 3.13
Use the same clock as :func:`time.perf_counter`. On Windows, :func:`monotonic`

@vadmium vadmium Nov 17, 2024

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.

Suggested change
Use the same clock as :func:`time.perf_counter`. On Windows, :func:`monotonic`
The function now uses the same clock as :func:`time.perf_counter`. On Windows, :func:`monotonic`

Sorry, something went wrong.

Uh oh!

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

All reactions
@dbstf dbstf closed this by deleting the head repository Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vadmium vadmium vadmium 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 needs backport to 3.13 only security fixes 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.

3 participants

@dbstf @vadmium @picnixz
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.