gh-110850: Add PyTime_TimeRaw() function#118394
Conversation
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.
encukou
left a comment
There was a problem hiding this comment.
Thank you!
I have a few suggestions, which I've also tested locally. I've sent them as a PR: vstinner#2
Sorry, something went wrong.
|
@encukou: I applied your suggestion, but I replaced the assert() with Py_FatalError(). Also, I added a code path with |
Sorry, something went wrong.
|
Don't bother too much about "Unchecked" functions. Once this PR will land, I will write a PR to remove "Unchecked" functions (use "Raw" functions instead). |
Sorry, something went wrong.
|
Thanks! |
Sorry, something went wrong.
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>
Add "Raw" variant of PyTime functions:
Changes:
📚 Documentation preview 📚: https://cpython-previews--118394.org.readthedocs.build/