Skip to content

Commit

Permalink
fix: reduce tick seelp rate from 1000ms to 500ms
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjackwills committed Nov 21, 2023
1 parent 5f9f382 commit 216eb19
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src-tauri/src/tick.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::sync::Arc;

use crate::{application_state::ApplicationState, internal_message_handler::InternalMessage};

/// Spawn off a tokio thread, that loops continually, well with a 250ms pause between each loop
/// Spawn off a tokio thread, that loops continually, well with a 500ms pause between each loop
/// The timer checking is then spawned off into another thread
/// The outer tread is saved into ApplicationState, so that it can be cancelled at any time
pub fn tick_process(state: &Arc<Mutex<ApplicationState>>) {
Expand All @@ -19,7 +19,7 @@ pub fn tick_process(state: &Arc<Mutex<ApplicationState>>) {
spawn_state.lock().tick_process();
});
// 500ms?
tokio::time::sleep(std::time::Duration::from_millis(1000)).await;
tokio::time::sleep(std::time::Duration::from_millis(500)).await;
}
}));
}

0 comments on commit 216eb19

Please sign in to comment.