Limited update loop speed using sleep()
This commit is contained in:
parent
a91ff86876
commit
3fe873c00c
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -959,7 +959,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pomd"
|
name = "pomd"
|
||||||
version = "1.2.0"
|
version = "1.3.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-std",
|
"async-std",
|
||||||
"confy",
|
"confy",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "pomd"
|
name = "pomd"
|
||||||
version = "1.2.0"
|
version = "1.3.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use std::{
|
use std::{
|
||||||
sync::{Arc, Mutex},
|
sync::{Arc, Mutex},
|
||||||
time::Duration,
|
time::Duration, thread::sleep,
|
||||||
};
|
};
|
||||||
|
|
||||||
use pausable_clock::{PausableClock, PausableInstant};
|
use pausable_clock::{PausableClock, PausableInstant};
|
||||||
@ -164,5 +164,6 @@ async fn main() -> Result<()> {
|
|||||||
.await?;
|
.await?;
|
||||||
loop {
|
loop {
|
||||||
pomd.lock().unwrap().update();
|
pomd.lock().unwrap().update();
|
||||||
|
sleep(Duration::from_millis(100));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user