SplitScript reference / Duration / fromHours

Duration.fromHours

Function

Duration.fromHours<T>(hours: T) -> Duration where T: Numeric

Constructs a duration from hours.

Every integer and floating-point type is accepted.

Parameters

  • hours: The number of elapsed hours.

Effects: pure

Runtime behavior: available everywhere; synchronous

Examples

Construct a one-hour timeout

let timeout = Duration.fromHours(1.0)