empty loop {} wastes CPU cycles

This commit is contained in:
MedzikUser 2022-02-13 13:24:56 +01:00
parent c7d9140362
commit c38375cb88
No known key found for this signature in database
GPG key ID: A5FAC1E185C112DB
2 changed files with 6 additions and 2 deletions

View file

@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
<!-- next-header -->
## [Unreleased]
### CLI
- fix: empty `loop {}` wastes CPU cycles
## [0.1.0] - 2022-02-13
### CLI

View file

@ -8,7 +8,7 @@ use discord_rich_presence::{
};
use std::{
process::exit,
time::{SystemTime, UNIX_EPOCH},
time::{Duration, SystemTime, UNIX_EPOCH},
vec,
};
@ -121,5 +121,7 @@ fn main() {
"Press Ctrl+C to exit!".magenta()
);
loop {}
loop {
std::thread::sleep(Duration::new(9999999, 9999999));
}
}