| ... | @@ -903,6 +903,10 @@ pub const Timestamp = struct { | ... | @@ -903,6 +903,10 @@ pub const Timestamp = struct { |
| 903 | return .{ .nanoseconds = x }; | 903 | return .{ .nanoseconds = x }; |
| 904 | } | 904 | } |
| 905 | | 905 | |
| | 906 | pub fn toMilliseconds(t: Timestamp) i64 { |
| | 907 | return @intCast(@divTrunc(t.nanoseconds, std.time.ns_per_ms)); |
| | 908 | } |
| | 909 | |
| 906 | pub fn toSeconds(t: Timestamp) i64 { | 910 | pub fn toSeconds(t: Timestamp) i64 { |
| 907 | return @intCast(@divTrunc(t.nanoseconds, std.time.ns_per_s)); | 911 | return @intCast(@divTrunc(t.nanoseconds, std.time.ns_per_s)); |
| 908 | } | 912 | } |