pub struct DefaultClock { /* private fields */ }Expand description
Default clock implementation using the best available raw monotonic source.
| Platform | Source | NTP-immune? |
|---|---|---|
| Linux | CLOCK_MONOTONIC_RAW | Yes |
| macOS | mach_absolute_time (via Instant) | Yes |
| Windows | QueryPerformanceCounter (via Instant) | Yes |
Implementations§
Source§impl DefaultClock
impl DefaultClock
Trait Implementations§
Source§impl Clock for DefaultClock
impl Clock for DefaultClock
Source§fn now_micros(&self) -> i64
fn now_micros(&self) -> i64
Monotonic microseconds from an arbitrary epoch. Read more
Source§fn micros_to_instant(&self, micros: i64) -> Option<Instant>
fn micros_to_instant(&self, micros: i64) -> Option<Instant>
Convert this clock’s microseconds to a
std::time::Instant. Read moreSource§fn instant_to_micros(&self, instant: Instant) -> i64
fn instant_to_micros(&self, instant: Instant) -> i64
Convert a
std::time::Instant to this clock’s microseconds. Read moreSource§impl Debug for DefaultClock
impl Debug for DefaultClock
Auto Trait Implementations§
impl Freeze for DefaultClock
impl RefUnwindSafe for DefaultClock
impl Send for DefaultClock
impl Sync for DefaultClock
impl Unpin for DefaultClock
impl UnsafeUnpin for DefaultClock
impl UnwindSafe for DefaultClock
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more