#timer #real-time

timer-queue

Pure, minimal, and scalable timers

2 unstable releases

0.1.0 Nov 11, 2022
0.0.0 Sep 28, 2022

#743 in Data structures

Download history 111/week @ 2023-06-05 145/week @ 2023-06-12 85/week @ 2023-06-19 131/week @ 2023-06-26 222/week @ 2023-07-03 124/week @ 2023-07-10 116/week @ 2023-07-17 176/week @ 2023-07-24 226/week @ 2023-07-31 110/week @ 2023-08-07 173/week @ 2023-08-14 143/week @ 2023-08-21 88/week @ 2023-08-28 119/week @ 2023-09-04 257/week @ 2023-09-11 704/week @ 2023-09-18

1,184 downloads per month

MIT OR Apache-2.0 OR Zlib

27KB
445 lines

timer-queue

License: Apache 2.0 License: MIT License: Zlib

A pure, minimal, and scalable structure for tracking expiration of timers

let mut q = TimerQueue::new();
q.insert(42, "second");
q.insert(17, "first");
assert!(q.next_timeout().unwrap() <= 17);
assert_eq!(q.poll(16), None);
assert_eq!(q.poll(17), Some("first"));
assert_eq!(q.poll(100), Some("second"));

License

Licensed under any of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be triple licensed as above, without any additional terms or conditions.

Dependencies

~45KB