SplitScript reference / Duration / lessThan

Duration.lessThan

Operator

Duration.lessThan(other: Duration) -> bool

Reports whether this duration is shorter than another duration.

This method implements the < operator using the normalized whole and fractional components without converting to floating point.

Parameters

  • other: The duration to compare against.

Effects: pure

Runtime behavior: available everywhere; synchronous

Examples

Check whether a delay is still pending

let elapsed = Duration.fromMilliseconds(200.0)
let delay = Duration.fromMilliseconds(250.0)
let pending = elapsed < delay