fast_time 0.1.26

An efficient low-precision timestamp source suitable for high-frequency querying
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::fmt::Debug;
use std::time::Instant;

pub(crate) trait Platform: Debug + Send + Sync + 'static {
    type TimeSource: TimeSource;

    fn new_time_source(&self) -> Self::TimeSource;
}

#[cfg_attr(test, mockall::automock)]
pub(crate) trait TimeSource: Debug + Send {
    fn now(&mut self) -> Instant;
}