main: run the throbber on a wallclock based timer, so the VU meter updates don't cause crazy spinning
This commit is contained in:
+6
-5
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user