duration
luau
local duration = require("@std/time/duration")WARNING
These APIs are still open to future evolution. In new major versions, they may change in backwards incompatible ways.
Summary
| Entry | Description |
|---|---|
| Duration | A span of time. |
| create | Creates a Duration from a number of seconds and an additional number of nanoseconds, subsecnanos. |
| days | Creates a Duration from a number of days. |
| hours | Creates a Duration from a number of hours. |
| microseconds | Creates a Duration from a number of microseconds. |
| milliseconds | Creates a Duration from a number of milliseconds. |
| minutes | Creates a Duration from a number of minutes. |
| nanoseconds | Creates a Duration from a number of nanoseconds. |
| seconds | Creates a Duration from a number of seconds. |
| weeks | Creates a Duration from a number of weeks. |
Types
Duration
A span of time.
luau
type Duration = time.DurationFunctions and Properties
duration.create
Creates a Duration from a number of seconds and an additional number of nanoseconds, subsecnanos.
luau
(seconds: number, subsecnanos: number) -> Durationduration.days
Creates a Duration from a number of days.
luau
(days: number) -> Durationduration.hours
Creates a Duration from a number of hours.
luau
(hours: number) -> Durationduration.microseconds
Creates a Duration from a number of microseconds.
luau
(microseconds: number) -> Durationduration.milliseconds
Creates a Duration from a number of milliseconds.
luau
(milliseconds: number) -> Durationduration.minutes
Creates a Duration from a number of minutes.
luau
(minutes: number) -> Durationduration.nanoseconds
Creates a Duration from a number of nanoseconds.
luau
(nanoseconds: number) -> Durationduration.seconds
Creates a Duration from a number of seconds.
luau
(seconds: number) -> Durationduration.weeks
Creates a Duration from a number of weeks.
luau
(weeks: number) -> Duration