1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
pub mod host;
use cap_std::time::Duration;

pub trait WasiWallClock: Send + Sync {
    fn resolution(&self) -> Duration;
    fn now(&self) -> Duration;
}

pub trait WasiMonotonicClock: Send + Sync {
    fn resolution(&self) -> u64;
    fn now(&self) -> u64;
}

pub struct WasiClocks {
    pub wall: Box<dyn WasiWallClock + Send + Sync>,
    pub monotonic: Box<dyn WasiMonotonicClock + Send + Sync>,
}