mirror of
https://github.com/zaphar/durnitisp.git
synced 2025-07-23 18:29:49 -04:00
probe: spread probe threads out uniformly in time
This way we're a little less bursty and might notice changes more quickly.
This commit is contained in:
parent
6fdce7e8d2
commit
f0a7c3ef02
@ -261,6 +261,10 @@ fn main() -> anyhow::Result<()> {
|
||||
}
|
||||
});
|
||||
parent.schedule(Box::new(connect_thread));
|
||||
// Spread the probe threads out so they're somewhat uniformly distributed.
|
||||
std::thread::sleep(std::time::Duration::from_micros(
|
||||
DELAYSECS.flag * 1000000 / (socket_addrs.len() as u64),
|
||||
))
|
||||
}
|
||||
// Blocks forever
|
||||
parent.wait();
|
||||
|
Loading…
x
Reference in New Issue
Block a user