Adds an FPS setting and slider.

This commit is contained in:
Cody
2019-06-06 15:11:39 -04:00
parent 8a19a6f2a3
commit 527f33a778
7 changed files with 70 additions and 26 deletions

View File

@ -3,7 +3,7 @@ use common::{clock::Clock, comp};
use log::{error, info};
use std::time::Duration;
const FPS: u64 = 60;
const TICK_RATE: u64 = 10; // Low value is okay, just reading messages.
fn main() {
// Initialize logging.
@ -48,6 +48,6 @@ fn main() {
client.cleanup();
// Wait for the next tick.
clock.tick(Duration::from_millis(1000 / FPS));
clock.tick(Duration::from_millis(1000 / TICK_RATE));
}
}