diff --git a/Cargo.toml b/Cargo.toml index e72c8af..6400892 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,3 +15,6 @@ sloggers = "0.2" windows = { path = "../windows" } money = { path = "../money" } + +[features] +no-thrash = [] diff --git a/src/influx.rs b/src/influx.rs index 24c7907..8c2d7e0 100644 --- a/src/influx.rs +++ b/src/influx.rs @@ -401,6 +401,7 @@ pub fn writer_str_or_meas(log_path: &str, warnings: Sender) -> (thread: }); if !rcvd_msg { + #[cfg(feature = "no-thrash")] thread::sleep(Duration::from_millis(1) / 10); } } diff --git a/src/latency.rs b/src/latency.rs index f45272c..039afb8 100644 --- a/src/latency.rs +++ b/src/latency.rs @@ -400,6 +400,7 @@ impl Manager { last.broadcast = loop_time; debug!(logger, "sent broadcast"); } else { + #[cfg(feature = "no-thrash")] thread::sleep(Duration::from_millis(1) / 10); }