pub struct Stopwatch(/* private fields */);Expand description
Elapsed real time, for measuring how long a piece of work took.
Deliberately not a Clock. A clock answers “what instant is this” for
values the store keeps — commit stamps, created_at, expiry comparisons —
and tests pin it so those come out deterministic. Measuring a duration needs
the opposite guarantees: a reading that only moves forward, never jumps when
the system clock is corrected, and reports the real elapsed time even while a
pinned clock says no time has passed. Both live here so ambient time has one
owner.
Nothing durable derives from a stopwatch — only diagnostics read one — so how long a run took never changes what it produces.
Implementations§
Auto Trait Implementations§
impl Freeze for Stopwatch
impl RefUnwindSafe for Stopwatch
impl Send for Stopwatch
impl Sync for Stopwatch
impl Unpin for Stopwatch
impl UnsafeUnpin for Stopwatch
impl UnwindSafe for Stopwatch
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