diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-05-24 20:06:56 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-05-24 21:40:08 -0400 |
| commit | 53d011fa1a7bfb2389e3677e1f6fcbe7a678e05f (patch) | |
| tree | 6dc248d8606088f7a288c00f6ccef78290229cf4 /lib/std/net.zig | |
| parent | c6e7d0fcfdf83531c5c931433528c540eee62e56 (diff) | |
| download | zig-53d011fa1a7bfb2389e3677e1f6fcbe7a678e05f.tar.gz zig-53d011fa1a7bfb2389e3677e1f6fcbe7a678e05f.zip | |
(breaking) std.time fixups and API changes
Remove the constants that assume a base unit in favor of explicit
x_per_y constants.
nanosecond calendar timestamps now use i128 for the type. This affects
fs.File.Stat, std.time.nanoTimestamp, and fs.File.updateTimes.
calendar timestamps are now signed, because the value can be less than
the epoch (the user can set their computer time to whatever they wish).
implement std.os.clock_gettime for Windows when clock id is
CLOCK_CALENDAR.
Diffstat (limited to 'lib/std/net.zig')
| -rw-r--r-- | lib/std/net.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/net.zig b/lib/std/net.zig index 96c95fc497..067c9026b0 100644 --- a/lib/std/net.zig +++ b/lib/std/net.zig @@ -1135,13 +1135,13 @@ fn resMSendRc( }}; const retry_interval = timeout / attempts; var next: u32 = 0; - var t2: u64 = std.time.milliTimestamp(); + var t2: u64 = @bitCast(u64, std.time.milliTimestamp()); var t0 = t2; var t1 = t2 - retry_interval; var servfail_retry: usize = undefined; - outer: while (t2 - t0 < timeout) : (t2 = std.time.milliTimestamp()) { + outer: while (t2 - t0 < timeout) : (t2 = @bitCast(u64, std.time.milliTimestamp())) { if (t2 - t1 >= retry_interval) { // Query all configured nameservers in parallel var i: usize = 0; |
