0.2.0 Preview 1 · Frozen documentation
DurationRounding
Selects explicit mathematical rounding when converting finite time units.
Sn is under heavy development. Reference extracted from this release’s bundled standard library. Public API examples are not an exhaustive compatibility test. Read the matching release guide for tested workflows and limitations. Read the status →
Module std.time
import std.time;Public declaration contracts and authored examples. A page can document several related symbols. Implementation bodies are excluded.
DurationRounding
pub enum DurationRoundingSelects explicit mathematical rounding when converting finite time units.
Exact never truncates. Floor/Ceil refer to signed numerical direction, so a negative magnitude may round differently from a positive one. NearestEven breaks exact half-tick ties toward an even target count. No mode yields infinity.
DurationRounding.Exact
Exact;Rejects any fractional target tick.
DurationRounding.Floor
Floor;Rounds toward negative infinity.
DurationRounding.Ceil
Ceil;Rounds toward positive infinity.
DurationRounding.NearestEven
NearestEven;Rounds to nearest, breaking equal-distance ties toward even.
Documentation snapshot: October 24, 2026 About versions ↗