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 events = EventStream::new();
|
||||||
|
let mut last_tick = Instant::now();
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
terminal.draw(|frame| { app.draw(frame)}).unwrap();
|
if last_tick.elapsed() >= std::time::Duration::from_millis(100) {
|
||||||
app.throbber_state.calc_next();
|
last_tick = Instant::now();
|
||||||
|
app.throbber_state.calc_next();
|
||||||
|
}
|
||||||
app.scene.direction.time_remaining = app.end_time.signed_duration_since(Utc::now());
|
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 delay = Delay::new(std::time::Duration::from_millis(60)).fuse();
|
||||||
let event = events.next().fuse();
|
let event = events.next().fuse();
|
||||||
|
|||||||
Reference in New Issue
Block a user