atm0s_reverse_proxy_protocol/time.rs
1use std::time::{SystemTime, UNIX_EPOCH};
2
3pub fn now_ms() -> u64 {
4 // Get the current time
5 let now = SystemTime::now();
6
7 // Calculate the duration since the UNIX epoch
8 let duration = now.duration_since(UNIX_EPOCH).expect("Time went backwards");
9
10 // Return the total milliseconds
11 duration.as_millis() as u64
12}