Fix high CPU usage on empty clipboard
This commit is contained in:
parent
81cdcc80ed
commit
605b5f5388
|
@ -46,6 +46,7 @@ fn main() -> Result<()> {
|
||||||
Ok(contents) => {
|
Ok(contents) => {
|
||||||
// Empty clipboard (Linux)
|
// Empty clipboard (Linux)
|
||||||
if contents.is_empty() {
|
if contents.is_empty() {
|
||||||
|
std::thread::sleep(std::time::Duration::from_millis(250));
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -62,7 +63,10 @@ fn main() -> Result<()> {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
// Empty clipboard (Mac, Windows)
|
// Empty clipboard (Mac, Windows)
|
||||||
Err(_) => continue,
|
Err(_) => {
|
||||||
|
std::thread::sleep(std::time::Duration::from_millis(250));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue