Crates.io | interval-task |
lib.rs | interval-task |
version | 0.3.3 |
source | src |
created_at | 2024-06-16 03:49:13.431679 |
updated_at | 2024-08-26 09:20:23.106379 |
description | Repeatedly execute a `Task` with fixed time delay. more than `setInterval` |
homepage | |
repository | https://github.com/ogios/interval-task |
max_upload_size | |
id | 1273254 |
size | 12,002 |
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.