interval-task

Crates.iointerval-task
lib.rsinterval-task
version0.3.4
created_at2024-06-16 03:49:13.431679+00
updated_at2025-01-01 06:20:57.639455+00
descriptionRepeatedly execute a `Task` with fixed time delay. more than `setInterval`
homepage
repositoryhttps://github.com/ogios/interval-task
max_upload_size
id1273254
size11,573
OGIOS (ogios)

documentation

https://docs.rs/interval-task/

README

interval-task

This crate provides a [runner][crate::runner] to simulate what setInterval does in JS which is repeatedly executing a task every given [Duration][std::time::Duration].

But since in rust we can't have that kind of flexibility like js, the runner here provides much more usage except for just pass in the function and delay. Also provide a [channel][channel] which wraps up [runner][crate::runner]

Please be aware that you have read [runner] doc.

This crate uses [spin_sleep] which provides accurate sleep. and i optimized to make the loop more accurate.

Purely thread with no async support.

Commit count: 19

cargo fmt