SolarEnergy/custom_consumption/src/utils.rs
Pierre HUBERT d0e426bbbc
All checks were successful
continuous-integration/drone/push Build is passing
Fix cargo clippy issue
2024-12-03 22:44:53 +01:00

10 lines
209 B
Rust

use std::time::{SystemTime, UNIX_EPOCH};
/// Get the current time since epoch
pub fn time_millis() -> u128 {
SystemTime::now()
.duration_since(UNIX_EPOCH)
.unwrap()
.as_millis()
}