pub struct DecisionTimer { /* private fields */ }Expand description
Time a region whose measurement drives a decision, profiled or not.
span deliberately measures nothing while profiling is off, which is
right for reporting and wrong for a measurement the product acts on. A
timer whose value picks a backend must produce the same value whether or
not an operator passed --profile, or the flag would change routing.
This guard therefore reads the clock unconditionally, returns the elapsed
duration to the caller, and additionally records it as a span would
when a runtime is current. The name says “decision” so a reader knows at
the call site that it costs a clock read even when profiling is off. On a
hot path where nothing acts on the value, use span.
Implementations§
Auto Trait Implementations§
impl Freeze for DecisionTimer
impl RefUnwindSafe for DecisionTimer
impl Send for DecisionTimer
impl Sync for DecisionTimer
impl Unpin for DecisionTimer
impl UnsafeUnpin for DecisionTimer
impl UnwindSafe for DecisionTimer
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