From 9e1edc06eb94471872442f61e9d761fd6ef4c5fa Mon Sep 17 00:00:00 2001 From: talwat <83217276+talwat@users.noreply.github.com> Date: Sun, 7 Dec 2025 23:08:07 +0100 Subject: [PATCH] fix: make clock updates more frequent --- src/ui/interface.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ui/interface.rs b/src/ui/interface.rs index 26588b0..705087a 100644 --- a/src/ui/interface.rs +++ b/src/ui/interface.rs @@ -23,7 +23,7 @@ impl Clock { /// This is to avoid constant calls to [`chrono::Local::now`], which /// is somewhat expensive because of timezones. pub fn update(&mut self, window: &mut Window) { - if self.0.elapsed().as_secs() >= 1 { + if self.0.elapsed().as_millis() >= 500 { window.display(Self::now(), 8); self.0 = Instant::now(); } @@ -80,7 +80,7 @@ pub(crate) fn menu(state: &mut ui::State, params: Params) -> Vec { Some(timer) => { let volume = state.sink.volume(); let percentage = format!("{}%", (volume * 100.0).round().abs()); - if timer.elapsed() > Duration::from_millis(500) { + if timer.elapsed() > Duration::from_secs(1) { state.timer = None; }