Skip to main content

interval

Function interval 

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

Creates a timer that emits events periodically, starting as soon as possible.

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_at_least when it’s preferable not to tick before the expected instants.