[−][src]Crate tokio_os_timer
This crate provides timers for use with tokio that rely on OS mechanisms for timer management
rather than a separate timing mechanism like tokio-timer
. This comes at somewhat increased
overhead if you have many timers, but allows the timers to have any granularity supported by
your operating system where tokio-timer
can only support timers with a granularity of 1ms.
In particular, the system timers usually support whatever granularity the underlying hardware
supports (see "High-resolution timers" in time(7)
), which on my laptop is 1ns!
The current implementation uses timerfd_create(2)
on Linux, and kqueue(2)
timers on
macOS and BSDs.
Structs
Delay | A future that completes a specified amount of time from its creation. |
Interval | A stream that yields once every time a fixed amount of time elapses. |