tokio-timer
tokio-timer copied to clipboard
Setting timer interval to 100ms causes high CPU usage
When calling timer.interval(Duration::from_millis(100)), the program takes up almost 100% of the CPU cycles, but after changing the interval from 100 to 101, the CPU usage dramatically drops to nealy 0%. Tested on macOS 10.12 with Rust 1.17.
Here is my code, you can reproduce it with cargo run --release 1000 100 and cargo run --release 1000 101.
Sounds like a bug!
This may be related to: https://github.com/tokio-rs/tokio-timer/issues/11