From 1b0feb913d0c0508045598f34a1acb821340421d Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Tue, 13 Jun 2023 19:28:02 +0900 Subject: [PATCH] progress: use common duration constants New update interval is 33ms, but I don't think that would matter. --- src/progress.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/progress.rs b/src/progress.rs index 21a8fb6a9..6baaa62db 100644 --- a/src/progress.rs +++ b/src/progress.rs @@ -182,7 +182,7 @@ pub fn snapshot_progress(ui: &mut Ui) -> Option { } // Don't clutter the output during fast operations. - let next_display_time = Instant::now() + Duration::from_millis(250); + let next_display_time = Instant::now() + INITIAL_DELAY; let state = Mutex::new(State { guard: None, ui, @@ -197,7 +197,7 @@ pub fn snapshot_progress(ui: &mut Ui) -> Option { // better handle large single files return; } - state.next_display_time = now + Duration::from_millis(10); + state.next_display_time = now + Duration::from_secs(1) / UPDATE_HZ; if state.guard.is_none() { state.guard = Some(