Duration
A signed time span, with nanosecond precision.
There is no constructor. Durations come from subtracting two
DateTimes or two Dates, and from APIs
elsewhere that report elapsed time.
Durations do not support arithmetic: they cannot be added, subtracted, scaled or negated.
Fields
nanos @ IntTotal nanoseconds. Exact.
secs @ FloatSeconds. Approximate: long spans lose sub-second precision.
Methods
(eq) other
Compares two durations.
(hash)()
Hashes the value.
(lt) other
Orders two durations.
(str)()
Returns a compact seconds form, such as 0s, 2.5s or -2.5s.