interval-task

Crates.iointerval-task
lib.rsinterval-task
version0.3.3
sourcesrc
created_at2024-06-16 03:49:13.431679
updated_at2024-08-26 09:20:23.106379
descriptionRepeatedly execute a `Task` with fixed time delay. more than `setInterval`
homepage
repositoryhttps://github.com/ogios/interval-task
max_upload_size
id1273254
size12,002
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: 10

cargo fmt