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

Function current_hour

nodedb/src/control/security/risk.rs:172–178  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

170}
171
172fn current_hour() -> u8 {
173 let secs = std::time::SystemTime::now()
174 .duration_since(std::time::UNIX_EPOCH)
175 .unwrap_or_default()
176 .as_secs();
177 ((secs % 86_400) / 3600) as u8
178}
179
180#[cfg(test)]
181mod tests {

Callers 1

scoreMethod · 0.85

Calls 2

nowFunction · 0.85
duration_sinceMethod · 0.80

Tested by

no test coverage detected