#async #utilities #timing #timestamp #hours

async_timing_util

tokio async functions for waiting until even intervals (on 1 min, 5 min, 30 min, etc), or waiting until a specified timestamp

16 releases (1 stable)

1.0.0 Jul 3, 2024
0.1.14 Jan 18, 2023
0.1.12 Dec 11, 2022
0.1.11 Nov 1, 2022
0.1.2 Sep 19, 2022

#752 in Asynchronous

Download history 7/week @ 2024-12-20 3/week @ 2024-12-27 15/week @ 2025-01-03 21/week @ 2025-01-10 13/week @ 2025-01-17 23/week @ 2025-01-24 136/week @ 2025-01-31 113/week @ 2025-02-07 54/week @ 2025-02-14 41/week @ 2025-02-21 69/week @ 2025-02-28 38/week @ 2025-03-07 24/week @ 2025-03-14 39/week @ 2025-03-21 24/week @ 2025-03-28 28/week @ 2025-04-04

124 downloads per month
Used in 8 crates (6 directly)

MIT license

8KB
163 lines

Async Timing Util

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.
}

Dependencies

~2.4–8.5MB
~68K SLoC