6 releases
0.3.4 | Jan 1, 2025 |
---|---|
0.3.3 | Aug 26, 2024 |
0.2.0 | Jun 21, 2024 |
0.1.1 |
|
#571 in Concurrency
189 downloads per month
9KB
172 lines
interval-task
This crate provides a runner
to simulate what setInterval
does in JS which is repeatedly executing a task every given 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 which wraps up 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.
Dependencies
~0.2–7MB
~49K SLoC