pub trait Clock: Send + Sync {
// Required methods
fn now_unix_secs(&self) -> u64;
fn now_monotonic(&self) -> Instant;
// Provided method
fn now_unix_millis(&self) -> u64 { ... }
}Required Methods§
Sourcefn now_unix_secs(&self) -> u64
fn now_unix_secs(&self) -> u64
Current wall-clock time as Unix epoch seconds.
Sourcefn now_monotonic(&self) -> Instant
fn now_monotonic(&self) -> Instant
A monotonically increasing instant for measuring durations. Implementations may return synthetic instants that share a base.
Provided Methods§
Sourcefn now_unix_millis(&self) -> u64
fn now_unix_millis(&self) -> u64
Current wall-clock time as Unix epoch milliseconds.