pub struct Since { /* private fields */ }Expand description
A moment to measure from, KEPT - what a Deadline cannot be, because it borrows the context it reads
the clock through and so cannot outlive the call that made it.
For a wait that is not a loop: something started now and asked about later, from a different call. A radio’s sweep is the first - each channel is listened to for a dwell, and the serve loop asks the radio once per turn whether it is time to tune the next; and the same loop times how long it has gone without reading a joined radio, and how long a request took to serve.
On an uncalibrated machine every budget has passed and nothing has elapsed. There is no duration
to compare with, and the alternative - nothing ever passes - turns a dwell into a hang; this way a
sweep still runs, only too fast to hear everything. calibrated says which case this is.
Implementations§
Source§impl Since
impl Since
Sourcepub fn now(ctx: &ServiceContext) -> Self
pub fn now(ctx: &ServiceContext) -> Self
Now.
Sourcepub fn passed(&self, ctx: &ServiceContext, budget: Budget) -> bool
pub fn passed(&self, ctx: &ServiceContext, budget: Budget) -> bool
Has budget passed since this moment?
Sourcepub fn elapsed_us(&self, ctx: &ServiceContext) -> u64
pub fn elapsed_us(&self, ctx: &ServiceContext) -> u64
Microseconds since this moment; 0 when uncalibrated, where it cannot be known.
Sourcepub fn elapsed_ms(&self, ctx: &ServiceContext) -> u64
pub fn elapsed_ms(&self, ctx: &ServiceContext) -> u64
Milliseconds since this moment; 0 when uncalibrated, where it cannot be known.
Sourcepub fn elapsed_ticks(&self, ctx: &ServiceContext) -> u64
pub fn elapsed_ticks(&self, ctx: &ServiceContext) -> u64
Counter ticks since this moment - the unit a benchmark reports in. Counts even when the machine is uncalibrated, because the counter runs whether or not anyone knows its rate.