@@ -249,28 +249,28 @@ pub const Clock = struct {
249
249
// https://www.freebsd.org/cgi/man.cgi?query=clock_gettime
250
250
fn toOsClockId (id : Id ) ? i32 {
251
251
return switch (id ) {
252
- .realtime = > os .CLOCK_REALTIME ,
252
+ .realtime = > os .CLOCK . REALTIME ,
253
253
.monotonic = > switch (target .os .tag ) {
254
254
// Calls mach_continuous_time() internally
255
- .macos , .tvos , .ios , .watchos = > os .CLOCK_MONOTONIC_RAW ,
256
- // Unlike CLOCK_MONOTONIC , this actually counts time suspended (true POSIX MONOTONIC)
257
- .linux = > os .CLOCK_BOOTTIME ,
258
- else = > os .CLOCK_MONOTONIC ,
255
+ .macos , .tvos , .ios , .watchos = > os .CLOCK . MONOTONIC_RAW ,
256
+ // Unlike CLOCK.MONOTONIC , this actually counts time suspended (true POSIX MONOTONIC)
257
+ .linux = > os .CLOCK . BOOTTIME ,
258
+ else = > os .CLOCK . MONOTONIC ,
259
259
},
260
260
.uptime = > switch (target .os .tag ) {
261
- .openbsd , .freebsd , .kfreebsd , .dragonfly = > os .CLOCK_UPTIME ,
261
+ .openbsd , .freebsd , .kfreebsd , .dragonfly = > os .CLOCK . UPTIME ,
262
262
// Calls mach_absolute_time() internally
263
- .macos , .tvos , .ios , .watchos = > os .CLOCK_UPTIME_RAW ,
264
- // CLOCK_MONOTONIC on linux actually doesn't count time suspended (not POSIX compliant).
265
- // At some point we may change our minds on CLOCK_MONOTONIC_RAW ,
266
- // but for now we're sticking with CLOCK_MONOTONIC standard.
263
+ .macos , .tvos , .ios , .watchos = > os .CLOCK . UPTIME_RAW ,
264
+ // CLOCK.MONOTONIC on linux actually doesn't count time suspended (not POSIX compliant).
265
+ // At some point we may change our minds on CLOCK.MONOTONIC_RAW ,
266
+ // but for now we're sticking with CLOCK.MONOTONIC standard.
267
267
// For more information, see: https://github.com/ziglang/zig/pull/933
268
- .linux = > os .CLOCK_MONOTONIC , // doesn't count time suspended
268
+ .linux = > os .CLOCK . MONOTONIC , // doesn't count time suspended
269
269
// Platforms like wasi and netbsd don't support getting time without suspend
270
270
else = > null ,
271
271
},
272
- .thread_cputime = > os .CLOCK_THREAD_CPUTIME_ID ,
273
- .process_cputime = > os .CLOCK_PROCESS_CPUTIME_ID ,
272
+ .thread_cputime = > os .CLOCK . THREAD_CPUTIME_ID ,
273
+ .process_cputime = > os .CLOCK . PROCESS_CPUTIME_ID ,
274
274
};
275
275
}
276
276
};
0 commit comments