Skip to content

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

License

Notifications You must be signed in to change notification settings

ogios/interval-task

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages