We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e473783 commit 88eafa4Copy full SHA for 88eafa4
library/std/src/sys/pal/unix/time.rs
@@ -271,7 +271,11 @@ impl Instant {
271
// we preserve this value domain out of an abundance of caution.
272
#[cfg(target_vendor = "apple")]
273
const clock_id: libc::clockid_t = libc::CLOCK_UPTIME_RAW;
274
- #[cfg(not(target_vendor = "apple"))]
+ // Instant is intended to progress forward during periods of suspension
275
+ // in both Android and Fuchsia, and therefore uses CLOCK_BOOTTIME.
276
+ #[cfg(any(target_os = "android", target_os = "fuchsia"))]
277
+ const clock_id: libc::clockid_t = libc::CLOCK_BOOTTIME;
278
+ #[cfg(not(any(target_vendor = "apple", target_os = "fuchsia", target_os = "android")))]
279
const clock_id: libc::clockid_t = libc::CLOCK_MONOTONIC;
280
Instant { t: Timespec::now(clock_id) }
281
}
0 commit comments