Shared time utilities for the security subsystem. Current wall-clock time in seconds since Unix epoch. Returns 0 on clock failure (extremely rare, only on broken systems). Used across security modules for timestamps, TTL, and expiry checks.
()
| 7 | /// Returns 0 on clock failure (extremely rare, only on broken systems). |
| 8 | /// Used across security modules for timestamps, TTL, and expiry checks. |
| 9 | pub fn now_secs() -> u64 { |
| 10 | std::time::SystemTime::now() |
| 11 | .duration_since(std::time::UNIX_EPOCH) |
| 12 | .unwrap_or_default() |
| 13 | .as_secs() |
| 14 | } |
| 15 | |
| 16 | /// Current wall-clock time in milliseconds since Unix epoch. |
| 17 | /// |
no test coverage detected