Browse Source

puts `thread::sleep`s behind a "no-thrash" feature

master
Jonathan Strong 7 years ago
parent
commit
5ef257a3b9
3 changed files with 5 additions and 0 deletions
  1. +3
    -0
      Cargo.toml
  2. +1
    -0
      src/influx.rs
  3. +1
    -0
      src/latency.rs

+ 3
- 0
Cargo.toml View File

@@ -15,3 +15,6 @@ sloggers = "0.2"


windows = { path = "../windows" } windows = { path = "../windows" }
money = { path = "../money" } money = { path = "../money" }

[features]
no-thrash = []

+ 1
- 0
src/influx.rs View File

@@ -401,6 +401,7 @@ pub fn writer_str_or_meas(log_path: &str, warnings: Sender<Warning>) -> (thread:
}); });


if !rcvd_msg { if !rcvd_msg {
#[cfg(feature = "no-thrash")]
thread::sleep(Duration::from_millis(1) / 10); thread::sleep(Duration::from_millis(1) / 10);
} }
} }


+ 1
- 0
src/latency.rs View File

@@ -400,6 +400,7 @@ impl Manager {
last.broadcast = loop_time; last.broadcast = loop_time;
debug!(logger, "sent broadcast"); debug!(logger, "sent broadcast");
} else { } else {
#[cfg(feature = "no-thrash")]
thread::sleep(Duration::from_millis(1) / 10); thread::sleep(Duration::from_millis(1) / 10);
} }




Loading…
Cancel
Save