Expand description
Compact monotonic time utilities.
Uses a process-local monotonic clock for timestamps that are smaller
than std::time::Instant (8 bytes vs 16 bytes for Option
Constants§
- NO_
EXPIRY - Sentinel value meaning “no expiry”.
Functions§
- expiry_
from_ duration - Converts a Duration to an absolute expiry timestamp.
- is_
expired - Returns true if the given expiry timestamp has passed.
- now_ms
- Returns current monotonic time in milliseconds since process start.
- remaining_
ms - Returns remaining TTL in milliseconds, or None if no expiry.
- remaining_
secs - Returns remaining TTL in seconds, or None if no expiry.