chron 0.1.2

A game loop with a fixed time step.
Documentation

chron

A game loop with a fixed time step.

Example

use std::num::NonZeroU32;

use chron::clock;

let updates_per_second = NonZeroU32::new(10).unwrap();
let frames_per_second = NonZeroU32::new(6).unwrap();

let clock = clock::Clock::new(updates_per_second)
    .with_frame_limit(frames_per_second)
    .with_frame_skip(3);

for tick in clock {
    match tick {
        clock::Tick::Update => {
            // ...
        }
        clock::Tick::Render { interpolation } => {
            // ...
        }
    }
}