]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-110850: Add PyTime_TimeRaw() function (#118394)
authorVictor Stinner <vstinner@python.org>
Wed, 1 May 2024 18:05:01 +0000 (20:05 +0200)
committerGitHub <noreply@github.com>
Wed, 1 May 2024 18:05:01 +0000 (18:05 +0000)
commitb52c753e0fb8b87c7a0e3f1c72acd18327d8d16b
tree0ffb22ddef0675046cd44d9aec0361b5fce0f4cd
parenta8bcf3ec3284f042dab9cad676951092fb1f9890
gh-110850: Add PyTime_TimeRaw() function (#118394)

Add "Raw" variant of PyTime functions:

* PyTime_MonotonicRaw()
* PyTime_PerfCounterRaw()
* PyTime_TimeRaw()

Changes:

* Add documentation and tests. Tests release the GIL while calling
  raw clock functions.
* py_get_system_clock() and py_get_monotonic_clock() now check that
  the GIL is hold by the caller if raise_exc is non-zero.
* Reimplement "Unchecked" functions with raw clock functions.

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Doc/c-api/time.rst
Doc/whatsnew/3.13.rst
Include/cpython/pytime.h
Lib/test/test_capi/test_time.py
Misc/NEWS.d/next/C API/2024-04-29-17-19-07.gh-issue-110850.vcpLn1.rst [new file with mode: 0644]
Modules/_testcapi/time.c
Python/pytime.c