Represents a time interval with nanoseconds precision.
- second : Std.Time.Second.Offset
Second offset of the duration.
- nano : Std.Time.Nanosecond.Span
Nanosecond span that ranges from -999999999 and 999999999
Instances For
Equations
- Std.Time.instReprDuration = { reprPrec := Std.Time.reprDuration✝ }
Equations
- One or more equations did not get rendered due to their size.
Equations
- Std.Time.instBEqDuration = { beq := fun (x y : Std.Time.Duration) => x.second == y.second && y.nano == x.nano }
Creates a new Duration
out of Nanosecond.Offset
.
Instances For
Checks if the duration is zero seconds and zero nanoseconds.
Instances For
Converts a Duration
to a Millisecond.Offset
Equations
- duration.toMilliseconds = Std.Time.Internal.UnitVal.mul duration.second 1000 + { val := (Std.Time.Internal.Bounded.LE.ediv duration.nano 1000000 Std.Time.Duration.toMilliseconds.proof_1).val }
Instances For
Converts a Duration
to a Minute.Offset
Equations
- tm.toMinutes = Std.Time.Internal.UnitVal.ediv tm.second 60
Instances For
Normalizes Second.Offset
and NanoSecond.span
in order to build a new Duration
out of it.
Equations
- Std.Time.Duration.fromComponents secs nanos = Std.Time.Duration.ofNanoseconds (secs.toNanoseconds + nanos.toOffset)
Instances For
Adds two durations together, handling any carry-over in nanoseconds.
Equations
- t₁.add t₂ = Std.Time.Duration.ofNanoseconds (t₁.toNanoseconds + t₂.toNanoseconds)
Instances For
Adds a Nanosecond.Offset
to a Duration
Instances For
Adds a Millisecond.Offset
to a Duration
Instances For
Adds a Millisecond.Offset
to a Duration
Instances For
Adds a Nanosecond.Offset
to a Duration
Instances For
Adds a Second.Offset
to a Duration
Equations
- t.addSeconds s = t.add (Std.Time.Duration.ofSeconds s)
Instances For
Subtracts a Second.Offset
from a Duration
Equations
- t.subSeconds s = t.sub (Std.Time.Duration.ofSeconds s)
Instances For
Adds a Minute.Offset
to a Duration
Equations
- t.addMinutes m = t.addSeconds (Std.Time.Internal.UnitVal.mul m 60)
Instances For
Subtracts a Minute.Offset
from a Duration
Equations
- t.subMinutes m = t.subSeconds (Std.Time.Internal.UnitVal.mul m 60)
Instances For
Adds an Hour.Offset
to a Duration
Instances For
Subtracts an Hour.Offset
from a Duration
Equations
- t.subHours h = t.subSeconds (Std.Time.Internal.UnitVal.mul h 3600)
Instances For
Adds a Day.Offset
to a Duration
Equations
- t.addDays d = t.addSeconds (Std.Time.Internal.UnitVal.mul d 86400)
Instances For
Subtracts a Day.Offset
from a Duration
Equations
- t.subDays d = t.subSeconds (Std.Time.Internal.UnitVal.mul d 86400)
Instances For
Adds a Week.Offset
to a Duration
Equations
- t.addWeeks w = t.addSeconds (Std.Time.Internal.UnitVal.mul w 604800)
Instances For
Subtracts a Week.Offset
from a Duration
Instances For
Equations
- Std.Time.Duration.instHSub = { hSub := Std.Time.Duration.sub }
Equations
- Std.Time.Duration.instHAdd = { hAdd := Std.Time.Duration.add }