Skip to main content

interval_delayed_by

Function interval_delayed_by 

Source
pub fn interval_delayed_by(
    delay: Duration,
    period: Duration,
) -> Result<Interval, IntervalError>
Expand description

Creates a timer that emits events periodically, starting after delay.

Returns an error if period is zero.

When throttling is activated (i.e. when using a non-0 wait duration in Context::acquire), timer entries are assigned to the nearest time frame, meaning that the delay might elapse wait / 2 ms earlier or later than the expected instant.

Use interval_delayed_by_at_least when it’s preferable not to tick before the expected instants.