use std::time::{SystemTime, UNIX_EPOCH};
/// Returns the current time in seconds since the UNIX epoch
pub fn timer() -> f64 {
match SystemTime::now().duration_since(UNIX_EPOCH) {
Ok(duration) => {
let seconds = duration.as_secs_f64();
seconds
},
Err(_) => {
// Handle error case (system time before UNIX epoch)
// This is extremely unlikely but we handle it gracefully
0.0
}
}
}