pub trait Timer {
// Required methods
fn now(&self) -> SystemTime;
fn wait(&self, duration: Duration);
}Expand description
Wall-clock time, and the ability to wait for some of it.
Deliberately not crate::env::Clock: that answers “what day is it” when
resolving which puzzle to work on, whereas throttling needs instants and
sleeps.
Required Methods§
Sourcefn now(&self) -> SystemTime
fn now(&self) -> SystemTime
The current wall-clock time.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".