Skip to content

Commit

Permalink
mega genius speedup for subprocesses
Browse files Browse the repository at this point in the history
i shrimply thought to myself "what if we just let it do its own thing and stop being such a fucking pest"

it seems subprocesses agree
  • Loading branch information
ZeWaka committed Jun 25, 2024
1 parent 83b1664 commit 27232d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/poll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ use std::sync::{Arc, Mutex};
/// Sends the poll data through the serial connection
pub fn send_poll_data(data: &Arc<Mutex<Vec<PollData>>>) -> std::string::String {
let poll_data = &mut *data.lock().unwrap();
if poll_data.is_empty() {
return String::new();
}
let poll_data_str = poll_data
.iter()
.map(|dat| format!("{} {} {}\n", dat.typ, &dat.pid, &dat.data))
Expand Down
2 changes: 1 addition & 1 deletion src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ pub fn process(
thread::spawn(move || {
let mut comms = proc
.communicate_start(None)
.limit_time(Duration::from_micros(500));
.limit_time(Duration::from_micros(1500));

// Loop the process inside the thread
loop {
Expand Down

0 comments on commit 27232d8

Please sign in to comment.