Expand description
This crate provides TimeSpan and TimeStamp types for working with time
in ergonomic way in game engines.
TimeSpan is a type that represents a time span in nanoseconds.
Similar to std::time::Duration, but smaller and thus faster.
TimeStamp is a type that represents a point in time in nanoseconds,
relative to reference point.
Clock is a type that represents a clock to measure time and steps.
Frequency and FrequencyTicker allow exact frequency ticker using
rational values.
§Features
Macros§
- timespan
- Converts human-readable expression into
TimeSpan. - ts
- Converts human-readable expression into
TimeSpan. Shortcut fortimespan!.
Structs§
- Clock
- Time measuring device.
Uses system monotonic clock counter
and yields
ClockSteps for each step. - Clock
Rate - Produces clock steps with given rate.
Uses external time span to advance the clock,
usually from some
Clock. - Clock
Step - Result of
Clockstep. Contains time stamp corresponding to “now” and time span since previous step. - Frequency
- Represents frequency as a rational number.
- Frequency
Ticker - Ticker with the given frequency.
- Frequency
Ticker Iter - Iterator over ticks from
FrequencyTicker. - Time
Span - An interval in between time stamps. This type is used to represent durations with nanosecond precision.
- Time
Stamp - A fixed point in time relative to a reference point in time.
Traits§
- Frequency
NumExt - This trait adds methods to integers to convert values into
Frequencys. - Time
Span NumExt - This trait adds methods to integers to convert values into
TimeSpans.