Skip to content

More accurate $get_start_time()#414

Merged
gaborcsardi merged 1 commit intomainfrom
fix/create-time-linux
Apr 20, 2026
Merged

More accurate $get_start_time()#414
gaborcsardi merged 1 commit intomainfrom
fix/create-time-linux

Conversation

@gaborcsardi
Copy link
Copy Markdown
Member

On Linux, process$get_start_time() now returns the correct wall-clock start time. Previously it was systematically ~0.3–0.5 s too early because the boot time was read from /proc/stat btime, which is truncated to whole seconds. processx now derives the boot time from
CLOCK_REALTIME − CLOCK_MONOTONIC, which has nanosecond precision. The ps package is updated in tandem to accept handles created by either the old or the new method, so new ps + old processx continues to work (#394, #402).

Closes #394, closes #402.

On Linux, `process$get_start_time()` now returns the correct wall-clock
start time. Previously it was systematically ~0.3–0.5 s too early because
the boot time was read from `/proc/stat btime`, which is truncated to whole
seconds. processx now derives the boot time from
`CLOCK_REALTIME − CLOCK_MONOTONIC`, which has nanosecond precision. The
ps package is updated in tandem to accept handles created by either the old
or the new method, so new ps + old processx continues to work (#394, #402).

Closes #394, closes #402.
@gaborcsardi gaborcsardi merged commit 2743e1e into main Apr 20, 2026
41 of 43 checks passed
@gaborcsardi gaborcsardi deleted the fix/create-time-linux branch April 20, 2026 12:11
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.

Timeout systematically too early on Linux Wrong starttime when multiple process of the same program

1 participant