naia_shared/backends/native/timestamp.rs
1use std::time::SystemTime;
2
3/// Returns the current wall-clock time as seconds since the Unix epoch.
4pub struct Timestamp;
5
6impl Timestamp {
7 /// Returns seconds since the Unix epoch as a `u64`.
8 pub fn now() -> u64 {
9 SystemTime::now()
10 .duration_since(SystemTime::UNIX_EPOCH)
11 .expect("timing error!")
12 .as_secs()
13 }
14}