SplitScript reference / Duration / fromParts

Duration.fromParts

Function

Duration.fromParts(seconds: i64, nanoseconds: i32) -> Duration

Constructs a duration from seconds and nanoseconds.

The two components become the runtime duration representation.

Parameters

  • seconds: Whole seconds.
  • nanoseconds: The fractional nanoseconds.

Effects: pure

Runtime behavior: available everywhere; synchronous

Examples

Construct an exact duration

let elapsed = Duration.fromParts(12, 500_000_000)