Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion library/std/src/sys/pal/unix/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,11 @@ impl Instant {
// we preserve this value domain out of an abundance of caution.
#[cfg(target_vendor = "apple")]
const clock_id: libc::clockid_t = libc::CLOCK_UPTIME_RAW;
#[cfg(not(target_vendor = "apple"))]
// Instant is intended to progress forward during periods of suspension
// in both Android and Fuchsia, and therefore uses CLOCK_BOOTTIME.
#[cfg(any(target_os = "android", target_os = "fuchsia"))]
const clock_id: libc::clockid_t = libc::CLOCK_BOOTTIME;
#[cfg(not(any(target_vendor = "apple", target_os = "fuchsia", target_os = "android")))]
const clock_id: libc::clockid_t = libc::CLOCK_MONOTONIC;
Instant { t: Timespec::now(clock_id) }
}
Expand Down
Loading