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

Function system_time_to_unix_nanos

nodedb/src/control/trace_export.rs:146–150  ·  view source on GitHub ↗
(t: SystemTime)

Source from the content-addressed store, hash-verified

144}
145
146fn system_time_to_unix_nanos(t: SystemTime) -> u64 {
147 t.duration_since(UNIX_EPOCH)
148 .map(|d| u64::try_from(d.as_nanos()).unwrap_or(u64::MAX))
149 .unwrap_or(0)
150}
151
152#[cfg(test)]
153mod tests {

Callers 1

emitMethod · 0.85

Calls 1

duration_sinceMethod · 0.80

Tested by

no test coverage detected