| Crates.io | async_timing_util |
| lib.rs | async_timing_util |
| version | 1.0.0 |
| created_at | 2022-09-02 14:15:30.49008+00 |
| updated_at | 2024-07-03 23:58:10.496073+00 |
| description | tokio async functions for waiting until even intervals (on 1 min, 5 min, 30 min, etc), or waiting until a specified timestamp |
| homepage | |
| repository | |
| max_upload_size | |
| id | 657402 |
| size | 8,648 |
Convenient utilities for doing repeated tasks at precise intervals.
use async_timing_util::{Timelength, wait_until_timelength};
loop {
let ts = wait_until_timelength(Timelength::OneHour, 0).await;
/// Do something async every hour, on the hour.
/// Runs at 00:00, 01:00, 02:00, etc.
}