Rust throttle_timer
Simple Rust library to throttle events and record event stats
Install Cargo.toml
throttle-timer = "1.0.0"
Example use
use Duration;
use ThrottleTimer;
let mut throttled_fn = new;
let mut val = 0_u8;
// timers always run when no previous runs
throttled_fn.run;
for _ in 0..100
throttled_fn.print_stats;
// throttled_fn called 0/sec, total calls 1, has been running for 10us
assert_eq!;
assert_eq!;