aboutsummaryrefslogtreecommitdiff
path: root/src/time.rs
blob: d34ee22b432f60374e6adfb873d75d935e60ef64 (plain) (blame)
1
2
3
4
5
6
7
8
9
use std::time::{SystemTime, UNIX_EPOCH};

/// Returns milliseconds since UNIX Epoch
pub fn now_msec() -> u64 {
    SystemTime::now()
        .duration_since(UNIX_EPOCH)
        .expect("Fix your clock :o")
        .as_millis() as u64
}