#task #multi-threading #interval #set-interval #time

interval-task

Repeatedly execute a Task with fixed time delay. more than setInterval

5 releases

new 0.3.3 Aug 26, 2024
0.3.2 Aug 13, 2024
0.2.0 Jun 21, 2024
0.1.1 Jun 16, 2024

#643 in Concurrency

Download history 239/week @ 2024-06-13 164/week @ 2024-06-20 5/week @ 2024-06-27 8/week @ 2024-07-04 31/week @ 2024-07-25 211/week @ 2024-08-01 145/week @ 2024-08-08 25/week @ 2024-08-15 117/week @ 2024-08-22

502 downloads per month

MIT license

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