pub trait Clock: Send + Sync { // Required method fn now(&self) -> Instant; // Provided method fn elapsed(&self, start: Instant) -> Duration { ... } }
Trait for time operations, allowing testability.
Get the current instant.
Get a duration since the given instant.