Skip to main content

interval

Macro interval 

Source
interval!() { /* proc-macro */ }
Expand description

The interval! macro for creating periodic timers.

The callback runs on the main thread each frame that the timer fires.

§Examples

let count = state!(cx, || 0u64);
let c = count.clone();
interval!(cx, Duration::from_secs(1), move || {
    c.update(|n| *n += 1);
});