#integer #tick #deterministic-id

tick-id

Tick ID for deterministic simulations

9 releases

0.0.9 Oct 10, 2024
0.0.8 Oct 10, 2024
0.0.7 Apr 28, 2024
0.0.6 Jan 26, 2024

#97 in Simulation

Download history 47/week @ 2025-08-20 39/week @ 2025-08-27 87/week @ 2025-09-03 24/week @ 2025-09-10 20/week @ 2025-09-17 112/week @ 2025-09-24 71/week @ 2025-10-01 35/week @ 2025-10-08 37/week @ 2025-10-15 73/week @ 2025-10-22 19/week @ 2025-10-29 29/week @ 2025-11-05 34/week @ 2025-11-12 23/week @ 2025-11-19 23/week @ 2025-11-26

115 downloads per month
Used in 17 crates (13 directly)

MIT license

6KB
51 lines

The TickId type represents a specific tick in a deterministic simulation.

A tick typically corresponds to a duration of 16 ms or 32 ms, but it can denote any positive integer time period, excluding zero. The TickId is implemented as a u32, allowing for a wide range of tick values.

Example

use tick_id::TickId;

let tick_id = TickId::new(1);
println!("Tick ID: {}", tick_id);

Operations

The TickId type supports addition and subtraction operations, allowing for easy manipulation of tick values. Overflow and underflow are checked during arithmetic operations to ensure safety.


📦 tick-id

Session unique Tick ID that specifies a specific tick in a deterministic simulation.

A tick represents any positive integer time period, excluding zero, with typical durations being 16 ms or 32 ms.

TickId is represented as a u32. With each tick equivalent to 16 ms, the maximum duration is approximately 68,719,476 seconds, which translates to about 2.18 years.

“2.18 years should be enough for everyone!”

Installation

[dependencies]
tick-id = "0.0.8"

No runtime deps