Zig 0.17.0-dev (Split by item) This is an example of documentation generated by
ZigDoc , an alternative to Zig's built-in
Auto Doc feature. See also
examples in other modes/formats . The project being documented here (as the example) is the Zig standard library.
std › Io › Threaded › clockToPosix Public Function clockToPosix Doc Source Public Function std.Io.Threaded.clockToPosix
pub fn clockToPosix (clock : Io .Clock ) posix .clockid_t Params File Io/Threaded.zig: 14384
14384
14385
14386
14387
14388
14389
14390
14391
14392
14393
14394
14395
14396
14397
14398
14399
14400
14401
14402
14403
14404
14405
14406 pub fn clockToPosix (clock : Io .Clock ) posix .clockid_t {
return switch (clock ) {
.real => posix .CLOCK .REALTIME ,
.awake => switch (native_os ) {
.driverkit , .ios , .maccatalyst , .macos , .tvos , .visionos , .watchos => posix .CLOCK .UPTIME_RAW ,
else => posix .CLOCK .MONOTONIC ,
},
.boot => switch (native_os ) {
.driverkit , .ios , .maccatalyst , .macos , .tvos , .visionos , .watchos => posix .CLOCK .MONOTONIC_RAW ,
// On freebsd derivatives, use MONOTONIC_FAST as currently there's
// no precision tradeoff.
.freebsd , .dragonfly => posix .CLOCK .MONOTONIC_FAST ,
// 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 ,
};
}