rainbeam_shared/
lib.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//! Xsu Utilities
#![doc = include_str!("../README.md")]
#![doc(issue_tracker_base_url = "https://github.com/swmff/rainbeam/issues/")]
pub mod fs;
pub mod hash;
pub mod path;
pub mod process;
pub mod ui;

// ...
use std::time::{SystemTime, UNIX_EPOCH};

/// Get a [`u128`] timestamp
pub fn unix_epoch_timestamp() -> u128 {
    let right_now = SystemTime::now();
    let time_since = right_now
        .duration_since(UNIX_EPOCH)
        .expect("Time travel is not allowed");

    return time_since.as_millis();
}