#timer #execution #schedule #closures #timestamp

timeware

A simple timer used to schedule execution of closures at a given timestamp

2 unstable releases

new 0.2.0 Apr 25, 2024
0.1.0 Aug 30, 2023

#28 in #schedule

Download history 11/week @ 2024-01-28 39/week @ 2024-02-04 21/week @ 2024-02-18 39/week @ 2024-02-25 16/week @ 2024-03-03 25/week @ 2024-03-10 31/week @ 2024-03-17 18/week @ 2024-03-24 28/week @ 2024-03-31 48/week @ 2024-04-07 160/week @ 2024-04-21

236 downloads per month

MIT license

13KB
190 lines

Timer

Simple implementation of a Timer in async Rust.

Example

let task = || {
    eprintln!("task was executed");
    None
};

let timer = Timer::new(task).with_graceful_shutdown(signal::ctrl_c());

timer.await;

lib.rs:

A simple timer, used to enqueue operations meant to be executed at a given time or after a given delay.

Dependencies

~4–6.5MB
~107K SLoC