Function ic_cdk::timer::set_timer

source ·
pub fn set_timer(delay: Duration, func: impl FnOnce() + 'static) -> TimerId
Expand description

Sets func to be executed later, after delay. Panics if delay + time() is more than u64::MAX nanoseconds.

To cancel the timer before it executes, pass the returned TimerId to clear_timer.

Note that timers are not persisted across canister upgrades.