MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / now_secs

Function now_secs

nodedb/src/control/security/time.rs:9–14  ·  view source on GitHub ↗

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.

()

Source from the content-addressed store, hash-verified

7/// Returns 0 on clock failure (extremely rare, only on broken systems).
8/// Used across security modules for timestamps, TTL, and expiry checks.
9pub 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///

Callers 2

registerMethod · 0.70
alter_userFunction · 0.50

Calls 2

nowFunction · 0.85
duration_sinceMethod · 0.80

Tested by

no test coverage detected