aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Silas Bartha <[email protected]>2023-12-29 18:29:21 -0500
committerLibravatar Silas Bartha <[email protected]>2023-12-29 18:29:21 -0500
commit3fe873c00c9f8e29f02b812e64ceac264fb56cc5 (patch)
tree471149b96f44edeaea8ac7db13230d8888aea26e
parenta91ff8687607ea35b6ea215482de38b6a79eb0ee (diff)
Limited update loop speed using sleep()
-rw-r--r--Cargo.lock2
-rw-r--r--Cargo.toml2
-rw-r--r--src/main.rs3
3 files changed, 4 insertions, 3 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 6d36301..989a4b7 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -959,7 +959,7 @@ dependencies = [
[[package]]
name = "pomd"
-version = "1.2.0"
+version = "1.3.0"
dependencies = [
"async-std",
"confy",
diff --git a/Cargo.toml b/Cargo.toml
index 790d314..271cfdb 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "pomd"
-version = "1.2.0"
+version = "1.3.0"
edition = "2021"
[dependencies]
diff --git a/src/main.rs b/src/main.rs
index af1eea7..992748c 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -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));
}
}