Function duration_until_wall_clock_is_multiple_of

Source
pub fn duration_until_wall_clock_is_multiple_of(duration: Duration) -> Duration
Expand description

Returns the duration until the wall clock is a multiple of duration.

§Example

Execute a timer every time the wall clock becomes a multiple of 5 seconds:

let period = Duration::from_secs(5);
let timer = get_timer("status_timer");
timer.repeated(
    duration_until_wall_clock_is_multiple_of(period),
    period,
);
timer.on_tick(|| todo!());