chore: add safe_yield

This commit is contained in:
Shunsuke Shibayama 2023-08-21 22:50:08 +09:00
parent 82792aca80
commit bcd4e4deb7
2 changed files with 8 additions and 2 deletions

View file

@ -50,3 +50,8 @@ where
.spawn(run)
.unwrap()
}
pub fn safe_yield() {
std::thread::yield_now();
std::thread::sleep(std::time::Duration::from_millis(10));
}