Skip to content

Commit

Permalink
add ticks per second const
Browse files Browse the repository at this point in the history
  • Loading branch information
joshka committed Sep 1, 2024
1 parent c6d2b6a commit 6ba914b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion simple-generated/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ impl App {
}

pub fn run(mut self, mut terminal: DefaultTerminal) -> Result<()> {
let tick_interval = Duration::from_secs_f64(1.0 / 10.0); // 10 ticks per second
const TICKS_PER_SECOND: f64 = 10.0;
let tick_interval = Duration::from_secs_f64(1.0 / TICKS_PER_SECOND);
let events = EventSource::new(tick_interval);
self.running = true;
while self.running {
Expand Down
3 changes: 2 additions & 1 deletion simple/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ impl App {
}

pub fn run(mut self, mut terminal: DefaultTerminal) -> Result<()> {
let tick_interval = Duration::from_secs_f64(1.0 / 10.0); // 10 ticks per second
const TICKS_PER_SECOND: f64 = 10.0;
let tick_interval = Duration::from_secs_f64(1.0 / TICKS_PER_SECOND);
let events = EventSource::new(tick_interval);
self.running = true;
while self.running {
Expand Down

0 comments on commit 6ba914b

Please sign in to comment.