commit cc751c01f13658280bc48905261f316b9b58b718 (tree)
parent ef55dcae675dd2048e5e404eb8bb6833d153f653
Author: Andrew Kelley <andrew@ziglang.org>
Date: Mon, 27 Oct 2025 14:59:42 -0700
std.Io.Threaded: correct clockToPosix for FreeBSD
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/lib/std/Io/Threaded.zig b/lib/std/Io/Threaded.zig
@@ -5006,6 +5006,9 @@ fn clockToPosix(clock: Io.Clock) posix.clockid_t {
},
.boot => switch (native_os) {
.macos, .ios, .watchos, .tvos => posix.CLOCK.MONOTONIC_RAW,
+ // On freebsd derivatives, use MONOTONIC_FAST as currently there's
+ // no precision tradeoff.
+ .freebsd, .dragonfly => posix.CLOCK.MONOTONIC_FAST,
else => posix.CLOCK.BOOTTIME,
},
.cpu_process => posix.CLOCK.PROCESS_CPUTIME_ID,