2 unstable releases

0.2.0 Jan 14, 2022
0.1.0 Mar 26, 2019

#520 in Unix APIs

Download history 3186/week @ 2025-10-10 4836/week @ 2025-10-17 6103/week @ 2025-10-24 7555/week @ 2025-10-31 6319/week @ 2025-11-07 6362/week @ 2025-11-14 9032/week @ 2025-11-21 5762/week @ 2025-11-28 6359/week @ 2025-12-05 6405/week @ 2025-12-12 4432/week @ 2025-12-19 1324/week @ 2025-12-26 2095/week @ 2026-01-02 3254/week @ 2026-01-09 3062/week @ 2026-01-16 2140/week @ 2026-01-23

10,662 downloads per month
Used in 10 crates (4 directly)

MIT license

18KB
379 lines

This crates provides tokio-timer-like API on top of timerfd. timerfd is a Linux-specific API providing timer notifications as file descriptor read events.

The advantage of timerfd is that it has more granularity than epoll_wait(), which only provides 1 millisecond timeouts. timerfd API allows for nanosecond precision, but precise timing of the wakeup is not guaranteed on a normal multitasking system.

Despite the name, this crate is not a part of the tokio project.

  • Delay: A future that completes at a specified instant in time.
  • Interval A stream that yields at fixed time intervals.
  • DelayQueue: A queue where items are returned once the requested delay has expired.

tokio-timerfd

Linux timerfd for Tokio.

This crates provides tokio-timer-like API on top of timerfd. timerfd is a Linux-specific API providing timer notifications as file descriptor read events.

The advantage of timerfd is that it has more granularity than epoll_wait(), which only provides 1 millisecond timeouts. timerfd API allows for nanosecond precision, but precise timing of the wakeup is not guaranteed on a normal multitasking system.

Dependencies

~4–18MB
~209K SLoC