progress: use common duration constants

New update interval is 33ms, but I don't think that would matter.
This commit is contained in:
Yuya Nishihara 2023-06-13 19:28:02 +09:00
parent 02bb3aecf3
commit 1b0feb913d

View file

@ -182,7 +182,7 @@ pub fn snapshot_progress(ui: &mut Ui) -> Option<impl Fn(&RepoPath) + '_> {
}
// 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<impl Fn(&RepoPath) + '_> {
// 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(