#timer #closures #async #execution #schedule #timestamp #task

timeware

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

2 unstable releases

0.2.0 Apr 25, 2024
0.1.0 Aug 30, 2023

#22 in #schedule

50 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.5–6.5MB
~109K SLoC