Function order [src]
Quickly compares two instances between each other.
Prototype
pub fn order(self: Instant, other: Instant) std.math.Order
Parameters
self: Instant
other: Instant
Source
pub fn order(self: Instant, other: Instant) std.math.Order {
// windows and wasi timestamps are in u64 which is easily comparible
if (!is_posix) {
return std.math.order(self.timestamp, other.timestamp);
}
var ord = std.math.order(self.timestamp.sec, other.timestamp.sec);
if (ord == .eq) {
ord = std.math.order(self.timestamp.nsec, other.timestamp.nsec);
}
return ord;
}