-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-126745: Fixup Docu time.rst #126744
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
gh-126745: Fixup Docu time.rst #126744
Conversation
- 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].
.. 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. |
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.
@@ -307,13 +312,21 @@ Functions | |||
.. versionchanged:: 3.10 | |||
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.
This comment was marked as resolved.
Sorry, something went wrong.
Use the same clock as :func:`time.perf_counter`. On Windows, :func:`monotonic` | ||
now call ``QueryPerformanceCounter()`` which has a resolution of 1 microsecond, |
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.
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, |
* Call ``clock_gettime(CLOCK_REALTIME)`` if available. | ||
* Otherwise, call ``gettimeofday()``. | ||
|
||
Use :func:`time_ns` to avoid the precision loss caused by the :class:`float` | ||
type. | ||
|
||
.. versionchanged:: 3.13 |
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.
.. versionchanged:: 3.13 | |
.. versionchanged:: 3.13 |
Suspect the mixed indentation is screwing it up
@@ -307,13 +312,21 @@ Functions | |||
.. versionchanged:: 3.10 | |||
On macOS, the function is now system-wide. | |||
|
|||
.. versionchanged:: 3.13 | |||
Use the same clock as :func:`time.perf_counter`. On Windows, :func:`monotonic` |
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.
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` |
📚 Documentation preview 📚: https://cpython-previews--126744.org.readthedocs.build/