Hyperlinkv0.8.0-beta.28

Duration

Duration.DurationObjectinterfaceeffect/Duration.ts:189
DurationObject

An object with optional duration components that can be combined to create a Duration. All fields are optional and additive.

Details

Compatible with Temporal.Duration-like objects.

Example (Combining duration object fields)

import { Duration } from "effect"

Duration.fromInputUnsafe({ seconds: 30 })
Duration.fromInputUnsafe({ days: 1 })
Duration.fromInputUnsafe({ seconds: 1, nanoseconds: 500 })
models
Source effect/Duration.ts:18910 lines
export interface DurationObject {
  readonly weeks?: number | undefined
  readonly days?: number | undefined
  readonly hours?: number | undefined
  readonly minutes?: number | undefined
  readonly seconds?: number | undefined
  readonly milliseconds?: number | undefined
  readonly microseconds?: number | undefined
  readonly nanoseconds?: number | undefined
}
Referenced by 2 symbols