Skip to content

Conversation

@ltratt
Copy link
Contributor

@ltratt ltratt commented Apr 26, 2025

os.clock uses libc's clock which measure "user + sys" time which is very rarely useful. This patch adds a new timer os.monotonic which returns a monotonic timer. On Linux, none of the monotonic timers is documented to do exactly what we would like: of those available, MONOTONIC seems the option least likely to produce misleading results, so we pick that.

`os.clock` uses libc's `clock` which measure "user + sys" time which is
very rarely useful. This patch adds a new timer `os.monotonic` which
returns a monotonic timer. On Linux, none of the monotonic timers is
documented to do exactly what we would like: of those available,
`MONOTONIC` seems the option least likely to produce misleading results,
so we pick that.
@ptersilie ptersilie added this pull request to the merge queue Apr 28, 2025
Merged via the queue into ykjit:main with commit 484deee Apr 28, 2025
2 checks passed
@ltratt ltratt deleted the os_monotonic branch May 30, 2025 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants