5 releases
new 0.3.3 | Aug 26, 2024 |
---|---|
0.3.2 | Aug 13, 2024 |
0.2.0 | Jun 21, 2024 |
0.1.1 |
|
#643 in Concurrency
502 downloads per month
9KB
197 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.4–8MB
~46K SLoC