A representation of a duration of time within a codebase. This class provides a way to work with durations of time in a type-safe manner.
toDays(): number
Converts the duration to days.
toHours(): number
Converts the duration to hours.
toMilliseconds(): number
Converts the duration to milliseconds.
toMinutes(): number
Converts the duration to minutes.
toSeconds(): number
Converts the duration to seconds.
toWeeks(): number
Converts the duration to weeks.
toYears(): number
Converts the duration to years.
fromMilliseconds(milliseconds: number): Duration
Creates a Duration from milliseconds.
fromMinutes(minutes: number): Duration
Creates a Duration from minutes.
fromSeconds(seconds: number): Duration
Creates a Duration from seconds.