GeneIT/geneit_backend/src/utils/time_utils.rs

12 lines
221 B
Rust

//! # Time utilities
use std::time::{SystemTime, UNIX_EPOCH};
/// Get the current time since epoch
pub fn time() -> u64 {
SystemTime::now()
.duration_since(UNIX_EPOCH)
.unwrap()
.as_secs()
}