main: run the throbber on a wallclock based timer, so the VU meter updates don't cause crazy spinning

This commit is contained in:
2026-06-02 11:30:21 +02:00
parent 3904285391
commit 6e29d88cf7
+6 -5
View File
@@ -642,15 +642,16 @@ async fn main() {
}
});
let mut app = App::new(prediction_request_in);
app.load();
let mut events = EventStream::new();
let mut last_tick = Instant::now();
loop {
terminal.draw(|frame| { app.draw(frame)}).unwrap();
app.throbber_state.calc_next();
if last_tick.elapsed() >= std::time::Duration::from_millis(100) {
last_tick = Instant::now();
app.throbber_state.calc_next();
}
app.scene.direction.time_remaining = app.end_time.signed_duration_since(Utc::now());
terminal.draw(|frame| { app.draw(frame)}).unwrap();
let delay = Delay::new(std::time::Duration::from_millis(60)).fuse();
let event = events.next().fuse();