We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 46753ab commit cb7af83Copy full SHA for cb7af83
src/worker.zig
@@ -1675,12 +1675,11 @@ pub const HTTPConn = struct {
1675
};
1676
1677
pub fn timestamp(clamp: u32) u32 {
1678
- if (comptime @hasDecl(posix, "CLOCK") == false or posix.CLOCK == void) {
+ if (comptime @hasDecl(posix, "CLOCK") == false or posix.CLOCK == void) {
1679
const value: u32 = @intCast(std.time.timestamp());
1680
return if (value <= clamp) return clamp + 1 else value;
1681
}
1682
- var ts: posix.timespec = undefined;
1683
- posix.clock_gettime(posix.CLOCK.MONOTONIC, &ts) catch unreachable;
+ const ts = posix.clock_gettime(posix.CLOCK.MONOTONIC) catch unreachable;
1684
return @intCast(ts.sec);
1685
1686
0 commit comments