API reference@evolu/common › Time

Time representations, durations, and scheduling utilities.

Functions

FunctionDescription
createTimeCreates a Time using Date.now() and globalThis.setTimeout.
durationToMillisConverts a duration to milliseconds.
formatMillisAsClockTimeFormats Millis as HH:MM:SS.mmm.
formatMillisAsDurationFormats Millis as a human-readable duration string.
millisToDateIsoConverts Millis to DateIso.
setTimeoutReturns a Promise that resolves after the specified duration.
testCreateTimeCreates a TestTime with controllable timers for testing.

Interfaces

InterfaceDescription
TestTimeTest Time with controllable timers.
TestTimeDep-
TimeTime and timer operations.
TimeDep-

Type Aliases

Type AliasDescription
DurationDuration can be either a DurationLiteral or milliseconds as Millis.
DurationLiteralDuration literal with compile-time validation.
DurationLiteralDaysDays duration: "1d" to "6d" or "1.1d" to "6.9d". See DurationLiteral.
DurationLiteralHoursHours duration: "1h" to "23h" or "1.1h" to "23.9h". See DurationLiteral.
DurationLiteralMillisecondsMilliseconds duration: "1ms" to "999ms". See DurationLiteral.
DurationLiteralMinutesMinutes duration: "1m" to "59m" or "1.1m" to "59.9m". See DurationLiteral.
DurationLiteralSecondsSeconds duration: "1s" to "59s" or "1.1s" to "59.9s". See DurationLiteral.
DurationLiteralWeeksWeeks duration: "1w" to "51w" or "1.1w" to "51.9w". See DurationLiteral.
DurationLiteralYearsYears duration: "1y" to "99y" or "1.1y" to "99.9y". See DurationLiteral.
MillisMilliseconds timestamp, like Date.now().
TimeoutIdOpaque type for timeout handles.

Variables

VariableDescription
maxMillisMaximum Millis value.
MillisMilliseconds timestamp, like Date.now().
minMillisMinimum Millis value.
ms120fpsFrame budget at 120fps (8ms).
ms60fpsFrame budget at 60fps (16ms).
msLongTaskLong task threshold (50ms).