API Reference › Duration
namespace

Duration

Spans of real time, measured in whole seconds and carried in a plain int — so a duration adds, subtracts and compares with the ordinary operators (Duration.minutes(5) + Duration.seconds(30), away > Duration.hours(3)). The constructors build a span from a unit; the as_* readers convert a span back to whole units (truncating toward zero). Integer-only, so no floating-point drift.

Duration.seconds(n) -> intA span of n whole seconds.Duration.minutes(n) -> intA span of n minutes, in seconds.Duration.hours(n) -> intA span of n hours, in seconds.Duration.days(n) -> intA span of n days, in seconds.Duration.as_seconds(span) -> intThe span in whole seconds.Duration.as_minutes(span) -> intThe span in whole minutes.Duration.as_hours(span) -> intThe span in whole hours.Duration.as_days(span) -> intThe span in whole days.
← All symbols