Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-110850: Add PyTime_TimeRaw() function#118394

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
vstinner merged 3 commits intopython:mainfromvstinner:time_raw
May 1, 2024

Conversation

vstinner
Copy link
Member

@vstinnervstinner commentedApr 29, 2024
edited by github-actionsbot
Loading

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.

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

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.
@vstinner
Copy link
MemberAuthor

cc@encukou

Copy link
Member

@encukouencukou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thank you!
I have a few suggestions, which I've also tested locally. I've sent them as a PR:vstinner#2

@vstinner
Copy link
MemberAuthor

@encukou: I applied your suggestion, but I replaced the assert() with Py_FatalError(). Also, I added a code path with(void) (to ignore the result) to ignore a potential compiler warning about unusedresult variable.

@vstinner
Copy link
MemberAuthor

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

encukou reacted with thumbs up emoji

@encukou
Copy link
Member

Thanks!
Looking forward to that :)

@vstinnervstinnerenabled auto-merge (squash)May 1, 2024 17:04
@vstinnervstinner merged commitb52c753 intopython:mainMay 1, 2024
@vstinnervstinner deleted the time_raw branchMay 1, 2024 18:05
SonicField pushed a commit to SonicField/cpython that referenced this pull requestMay 8, 2024
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>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@encukouencukouencukou approved these changes

@pgansslepganssleAwaiting requested review from pgansslepganssle is a code owner

@abalkinabalkinAwaiting requested review from abalkinabalkin is a code owner

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@vstinner@encukou

[8]ページ先頭

©2009-2025 Movatter.jp