mirror of
https://github.com/talwat/lowfi
synced 2025-12-19 13:13:21 +00:00
fix: make clock updates more frequent
This commit is contained in:
parent
abc88b2c86
commit
9e1edc06eb
@ -23,7 +23,7 @@ impl Clock {
|
|||||||
/// This is to avoid constant calls to [`chrono::Local::now`], which
|
/// This is to avoid constant calls to [`chrono::Local::now`], which
|
||||||
/// is somewhat expensive because of timezones.
|
/// is somewhat expensive because of timezones.
|
||||||
pub fn update(&mut self, window: &mut Window) {
|
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);
|
window.display(Self::now(), 8);
|
||||||
self.0 = Instant::now();
|
self.0 = Instant::now();
|
||||||
}
|
}
|
||||||
@ -80,7 +80,7 @@ pub(crate) fn menu(state: &mut ui::State, params: Params) -> Vec<String> {
|
|||||||
Some(timer) => {
|
Some(timer) => {
|
||||||
let volume = state.sink.volume();
|
let volume = state.sink.volume();
|
||||||
let percentage = format!("{}%", (volume * 100.0).round().abs());
|
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;
|
state.timer = None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user