1
2
3
4
5
6
7
8
9
// helper method
#[inline]
pub fn unix_timestamp() -> u64 {
    use std;
    std::time::SystemTime::now()
        .duration_since(std::time::UNIX_EPOCH)
        .expect("Time went backwards!")
        .as_secs()
}