aboutsummaryrefslogtreecommitdiff
path: root/std
diff options
context:
space:
mode:
Diffstat (limited to 'std')
-rw-r--r--std/os/time.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/std/os/time.zig b/std/os/time.zig
index 42f32f8fee..304f65206a 100644
--- a/std/os/time.zig
+++ b/std/os/time.zig
@@ -84,9 +84,9 @@ fn milliTimestampDarwin() u64 {
var tv: darwin.timeval = undefined;
var err = darwin.gettimeofday(&tv, null);
debug.assert(err == 0);
- const sec_ms = @intCast(u64, tv.tv_sec) * ms_per_s;
- const usec_ms = @divFloor(@intCast(u64, tv.tv_usec), us_per_s / ms_per_s);
- return u64(sec_ms) + u64(usec_ms);
+ const sec_ms = tv.tv_sec * ms_per_s;
+ const usec_ms = @divFloor(tv.tv_usec, us_per_s / ms_per_s);
+ return @intCast(u64, sec_ms + usec_ms);
}
fn milliTimestampPosix() u64 {