Detegr / rust-ctrlc

Easy Ctrl-C handler for Rust projects
https://crates.io/crates/ctrlc
Other
599 stars 79 forks source link

eats CPU during readme example #33

Closed inv2004 closed 7 years ago

inv2004 commented 7 years ago

Found that readme example (possible while loop?) eats CPU intensively >30%. Windows - 10

Are where any workaround? Because looks likes its the only library for windows.

Detegr commented 7 years ago

The example is very simple (even too simple, it seems), the high CPU load is caused by the spinloop that polls running. Try using this version for reduced CPU usage.