From 3fe873c00c9f8e29f02b812e64ceac264fb56cc5 Mon Sep 17 00:00:00 2001 From: Silas Bartha Date: Fri, 29 Dec 2023 18:29:21 -0500 Subject: Limited update loop speed using sleep() --- src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') 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)); } } -- cgit v1.2.3