this post was submitted on 18 Sep 2023
7 points (73.3% liked)
Rust Programming
8197 readers
42 users here now
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
what library is it from?
The clokwerk crate.
@SuddenlyBlowGreen @nothingness I recently needed that, but fuzzy. Like I want a task ran anywhere between 1PM and 2PM. Can this be accomplished with the clockwerk crate?
You could schedule a task at 1 PM, then generate a random number between 0-60 inside that task, wait that many minutes, then launch the actual task.