joule-profiler-core 2.1.0

Core library for joule-profiler, handling orchestration and energy measurements
Documentation
1
2
3
4
5
6
7
8
9
use std::time::{Duration, SystemTime, UNIX_EPOCH};

/// Get the current system timestamp in microseconds.
pub fn get_timestamp_micros() -> u128 {
    SystemTime::now()
        .duration_since(UNIX_EPOCH)
        .unwrap_or(Duration::from_secs(0))
        .as_micros()
}