Skip to content

use CLOCK_BOOTTIME in Instant::now#88714

Closed
hellow554 wants to merge 2 commits intorust-lang:masterfrom
hellow554:boottime
Closed

use CLOCK_BOOTTIME in Instant::now#88714
hellow554 wants to merge 2 commits intorust-lang:masterfrom
hellow554:boottime

Conversation

@hellow554
Copy link
Contributor

@hellow554 hellow554 commented Sep 7, 2021

There was a discussion on #87907 that all platforms expect
linux advance its monotonic timer if the system goes into a sleep state
(e.g. suspend or hibernate).
It was decided that CLOCK_BOOTTIME should be used on inux targets, but
because that constant would break older systems (e.g. linux kernels
<2.6.39) there should be a fallback to CLOCK_MONOTONIC.

Related to #87907
Closes #87906

cc @joshtriplett @cuviper

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-time Area: Time relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Instant::duration_since returns a shortened duration if a suspend occurred