SplitScript reference / Duration / add
Duration.add
Operator
Duration.add(other: Duration) -> Duration
Adds another duration and normalizes the result.
The returned nanosecond component preserves the Duration invariant.
Parameters
other: The duration to add.
Effects: pure
Runtime behavior: available everywhere; synchronous
Examples
Accumulate two measured intervals
let first = Duration.fromMilliseconds(250.0)
let second = Duration.fromMilliseconds(500.0)
let total = first.add(second)