Skip to content

Commit

Permalink
back to elapsed
Browse files Browse the repository at this point in the history
  • Loading branch information
raphamorim committed Jan 3, 2025
1 parent 28063c2 commit 3aa634d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/screen/tui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ fn run_app<B: Backend>(
loop {
terminal.draw(|f| ui(f, &mut app))?;

let timeout = Duration::from_millis(5);
let timeout = app
.tick_rate
.checked_sub(last_tick.elapsed())
.unwrap_or_else(|| Duration::from_secs(0));
if ratatui::crossterm::event::poll(timeout)? {
if let Event::Key(key) = event::read()? {
let is_pressed = key.kind == KeyEventKind::Press;
Expand Down

0 comments on commit 3aa634d

Please sign in to comment.