Hyperlinkv0.8.0-beta.28

Duration

Duration.Inputtypeeffect/Duration.ts:158
Input

Valid input types that can be converted to a Duration.

When to use

Use when an API should accept any value that Effect can convert into a Duration, including existing durations, millisecond numbers, nanosecond bigints, high-resolution tuples, duration strings, infinity strings, or duration objects.

Details

String inputs accept values like "10 seconds", "500 millis", "Infinity", and "-Infinity". Finite fractional values that are normalized to nanoseconds are rounded to the nearest nanosecond, with ties away from zero.

export type Input =
  | Duration
  | number // millis
  | bigint // nanos
  | readonly [seconds: number, nanos: number]
  | `${number} ${Unit}`
  | "Infinity"
  | "-Infinity"
  | DurationObject
Referenced by 70 symbols