From 6626110758270acede659e1281fa14f1ab72f245 Mon Sep 17 00:00:00 2001 From: vanten-s Date: Thu, 12 Oct 2023 22:01:17 +0200 Subject: [PATCH] Major performace increase --- src/listener_server.rs | 2 +- src/writer_client.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/listener_server.rs b/src/listener_server.rs index 65319ff..5633f1c 100644 --- a/src/listener_server.rs +++ b/src/listener_server.rs @@ -36,9 +36,9 @@ pub fn listen_to_client(tx: mpsc::Sender, rx: mpsc::Receiver, po } Err(_e) => {} } + thread::sleep(Duration::from_millis(1)); } let _ = tx.send(String::from_utf8_lossy(&buffer).to_string()); - thread::sleep(Duration::from_millis(100)); } } diff --git a/src/writer_client.rs b/src/writer_client.rs index dfe2bb3..262544b 100644 --- a/src/writer_client.rs +++ b/src/writer_client.rs @@ -51,9 +51,9 @@ pub fn write_to_server( Ok(_) => {} Err(_e) => println!("Couldn't send {value}"), }; + thread::sleep(Duration::from_millis(1)); } let _ = tx.send(dbg!(String::from_utf8_lossy(&buffer).to_string())); - thread::sleep(Duration::from_millis(100)); } }