Limited update loop speed using sleep()

This commit is contained in:
Silas Bartha 2023-12-29 18:29:21 -05:00
parent a91ff86876
commit 3fe873c00c
Signed by: soaos
GPG Key ID: 9BD3DCC0D56A09B2
3 changed files with 4 additions and 3 deletions

2
Cargo.lock generated
View File

@ -959,7 +959,7 @@ dependencies = [
[[package]]
name = "pomd"
version = "1.2.0"
version = "1.3.0"
dependencies = [
"async-std",
"confy",

View File

@ -1,6 +1,6 @@
[package]
name = "pomd"
version = "1.2.0"
version = "1.3.0"
edition = "2021"
[dependencies]

View File

@ -1,6 +1,6 @@
use std::{
sync::{Arc, Mutex},
time::Duration,
time::Duration, thread::sleep,
};
use pausable_clock::{PausableClock, PausableInstant};
@ -164,5 +164,6 @@ async fn main() -> Result<()> {
.await?;
loop {
pomd.lock().unwrap().update();
sleep(Duration::from_millis(100));
}
}