diff options
author | HimbeerserverDE <himbeerserverde@gmail.com> | 2022-12-29 13:19:36 +0100 |
---|---|---|
committer | HimbeerserverDE <himbeerserverde@gmail.com> | 2022-12-29 13:19:36 +0100 |
commit | 9b2a9566ce3bfce2fa16e2b9b25d36129617a24b (patch) | |
tree | f55714a8dc7c906fafe3c1d6ef9c828eedefb6cf | |
parent | 536b52430addcfc8109b8d0e855272d416964e40 (diff) |
sleep for max duration to avoid wasting cpu cycles
-rw-r--r-- | src/main.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index 059f23f..9514132 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,6 +3,7 @@ use std::fs; use std::io::Write; use std::process::{self, Command, ExitCode}; use std::thread; +use std::time::Duration; use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, WriteColor}; fn start() -> anyhow::Result<()> { @@ -74,6 +75,6 @@ fn main() -> ExitCode { } loop { - thread::yield_now(); + thread::sleep(Duration::MAX); } } |