mirror of
https://github.com/ziglang/zig.git
synced 2026-02-21 00:35:10 +00:00
Merge pull request #25936 from Traxar/master
Add some missing features to `std.Io.Timestamp` and `spirv/CodeGen.zig`
This commit is contained in:
commit
6ecf497714
@ -903,6 +903,10 @@ pub const Timestamp = struct {
|
||||
return .{ .nanoseconds = x };
|
||||
}
|
||||
|
||||
pub fn toMilliseconds(t: Timestamp) i64 {
|
||||
return @intCast(@divTrunc(t.nanoseconds, std.time.ns_per_ms));
|
||||
}
|
||||
|
||||
pub fn toSeconds(t: Timestamp) i64 {
|
||||
return @intCast(@divTrunc(t.nanoseconds, std.time.ns_per_s));
|
||||
}
|
||||
|
||||
@ -2176,6 +2176,14 @@ const UnaryOp = enum {
|
||||
.ceil => .Ceil,
|
||||
.trunc => .Trunc,
|
||||
.round => .Round,
|
||||
.sin => .Sin,
|
||||
.cos => .Cos,
|
||||
.tan => .Tan,
|
||||
.sqrt => .Sqrt,
|
||||
.exp => .Exp,
|
||||
.exp2 => .Exp2,
|
||||
.log => .Log,
|
||||
.log2 => .Log2,
|
||||
else => return null,
|
||||
})),
|
||||
else => unreachable,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user