ic-cdk-timers

Crates.ioic-cdk-timers
lib.rsic-cdk-timers
version0.9.0
sourcesrc
created_at2023-02-03 18:15:13.871469
updated_at2024-07-01 17:17:37.653675
descriptionTimers library for the Rust CDK.
homepagehttps://docs.rs/ic-cdk
repositoryhttps://github.com/dfinity/cdk-rs
max_upload_size
id775798
size26,706
Kyle Peacock (krpeacock)

documentation

https://docs.rs/ic-cdk-timers

README

Rust CDK Timers Library

Documentation Crates.io License Downloads CI

This crate provides a library to schedule multiple and periodic tasks on the Internet Computer.

Example

In Cargo.toml:

[dependencies]
ic-cdk-timers = "0.9.0"

To schedule a one-shot task to be executed 1s later:

ic_cdk_timers::set_timer(Duration::from_secs(1), || ic_cdk::println!("Hello from the future!"));

References

  1. Internet Computer Developer Guide: Periodic Tasks and Timers
  2. Example: Periodic Tasks and Timers (compares timers and heartbeats).
Commit count: 318

cargo fmt