xhcid: Sleep for 2ms on every poll loop
This significantly reduces cpu usage. On my laptop before this change a single core would be fully loaded while running at 3-4GHz. With this change it would only be loaded for about 50% while running at 1-2GHz. This improves battery lifetime while also preventing the fan from spinning up to a distracting level. This shouldn't noticably affect latency given that most keyboards and mice don't support polling at 500Hz anyway.
This commit is contained in:
@@ -105,7 +105,7 @@ impl IrqReactor {
|
||||
}
|
||||
// TODO: Configure the amount of time wait when no more work can be done (for IRQ-less polling).
|
||||
fn pause(&self) {
|
||||
std::thread::yield_now();
|
||||
std::thread::sleep(std::time::Duration::from_millis(2));
|
||||
}
|
||||
fn run_polling(mut self) {
|
||||
debug!("Running IRQ reactor in polling mode.");
|
||||
|
||||
Reference in New Issue
Block a user