Commit 3de1b6c9a9
Changed files (1)
lib
std
lib/std/Io/Threaded.zig
@@ -5009,7 +5009,12 @@ fn clockToPosix(clock: Io.Clock) posix.clockid_t {
// On freebsd derivatives, use MONOTONIC_FAST as currently there's
// no precision tradeoff.
.freebsd, .dragonfly => posix.CLOCK.MONOTONIC_FAST,
- else => posix.CLOCK.BOOTTIME,
+ // On linux, use BOOTTIME instead of MONOTONIC as it ticks while
+ // suspended.
+ .linux => posix.CLOCK.BOOTTIME,
+ // On other posix systems, MONOTONIC is generally the fastest and
+ // ticks while suspended.
+ else => posix.CLOCK.MONOTONIC,
},
.cpu_process => posix.CLOCK.PROCESS_CPUTIME_ID,
.cpu_thread => posix.CLOCK.THREAD_CPUTIME_ID,