Quick start · Scheduler · Tests
use realm_runtime::{DurationExt, Tick, TickLoop, TickRate};
fn main() {
let rate = TickRate::new(20).unwrap();
let mut clock = TickLoop::new(rate, 4, |_| {});
clock.step(10);
assert_eq!(clock.time().tick, Tick(10));
assert_eq!(clock.time().elapsed, 500.millis());
}A standalone Rust library for running a game simulation at a fixed tick rate. It provides manual and real-time stepping, ordered systems, lifecycle hooks, and seeded randomness for reproducible runs.
|
Feed elapsed time to |
|
|
|
Register systems on a |
|
Keep a |
|
|
Clock
|
Pacing
|
Drivers
|
|
Schedule
|
Lifecycle
|
Simulation tools
|
The clock and thread driver use the standard library. The math module re-exports glam.
With Rust 1.99 or newer and Cargo, add the crate to an existing Rust project.
cargo add --git https://github.com/mpge/realm-runtime realm-runtimePut the example in src/main.rs of a binary crate and run cargo run. Change the rate to see how much simulation time ten ticks cover.
| Topic | Reference |
|---|---|
| Drive a simulation | Tick loop · Time arithmetic |
| Extend the schedule | Builder and plugins · Clock and ordering tests |
MIT License, copyright © 2026 Matthew Gros.
Realm is an independent project and is not affiliated with or endorsed by Laravel Holdings Inc.