tokio-timer icon indicating copy to clipboard operation
tokio-timer copied to clipboard

Setting timer interval to 100ms causes high CPU usage

Open gyk opened this issue 8 years ago • 2 comments

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.

gyk avatar Aug 23 '17 04:08 gyk

Sounds like a bug!

carllerche avatar Aug 23 '17 16:08 carllerche

This may be related to: https://github.com/tokio-rs/tokio-timer/issues/11

carllerche avatar Sep 29 '17 14:09 carllerche