Skip to content

Commit

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

let timeout = app
.tick_rate
.checked_sub(last_tick.elapsed())
.unwrap_or_else(|| Duration::from_secs(0));
let timeout = Duration::from_millis(5);
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 28063c2

Please sign in to comment.