Skip to content

Commit

Permalink
Main fix
Browse files Browse the repository at this point in the history
Fixes CPU usage for the main empty infinite loop.
  • Loading branch information
Aeron committed Jan 24, 2023
1 parent 36aa1dc commit 5db7589
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main.rs
Expand Up @@ -36,5 +36,8 @@ async fn main() {
task::spawn(listen(addr));
}

loop {}
loop {
// HACK: drastically lowers the CPU usage of an infinite loop
task::sleep(Duration::from_secs(60)).await;
}
}

0 comments on commit 5db7589

Please sign in to comment.