File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
library/std/src/sys/pal/unix Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -271,7 +271,11 @@ impl Instant {
271271 // we preserve this value domain out of an abundance of caution.
272272 #[ cfg( target_vendor = "apple" ) ]
273273 const clock_id: libc:: clockid_t = libc:: CLOCK_UPTIME_RAW ;
274- #[ cfg( not( target_vendor = "apple" ) ) ]
274+ // 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" ) ) ) ]
275279 const clock_id: libc:: clockid_t = libc:: CLOCK_MONOTONIC ;
276280 Instant { t : Timespec :: now ( clock_id) }
277281 }
You can’t perform that action at this time.
0 commit comments