Native Timer for Rust
Provide a timer functionality which uses OS capabilities. Currently supports Windows, Linux, and MacOS.
Currently, only both Windows and Linux platforms are supported.
Features
tracker
(default) - Enable static callback tracker. It should minimize the native callback into an invalid timer context, that has been recently destroyed.
Examples
To fire an one-shot task:
# use ;
# use thread;
# use Duration;
use fire_oneshot;
let flag = new;
let shared_flag = flag.clone;
fire_oneshot.unwrap;
sleep;
assert!;
For more usages, see /src/examples/simple.rs
.
Credit
Linux and MacOS implementations are recovered from Autd3 open source library
on tag v1.10.0
, which is before being removed by commits afterwards.