1 2 3 4 5 6 7 8 9 10
#[derive(Clone, Copy, Debug, Default)] pub struct Monotonic { _default: (), } impl Monotonic { pub fn now(&self) -> u64 { unsafe { wasi::clock_time_get(wasi::CLOCKID_MONOTONIC, 1).expect("failed to get time") } } }