Skip to main content

Module time

Module time 

Source
Expand description

Virtual monotonic time.

Deliberately not std::time::Instant or any runtime’s instant type: neither can be constructed at an arbitrary value, which makes a seeded, replayable run impossible.

std::time::Duration has no such problem — it is a pure value type with no clock behind it — so it is what Time is built from. The newtype is still worth having: a Time is a point and a Duration is a span, and keeping them distinct is what stops one being passed where the other belongs.

Structs§

Time
A point in time, measured as an offset from the start of a run.