API reference@evolu/commonTime › TestTime

Defined in: packages/common/src/Time.ts:78

Test Time with controllable timers.

Call advance(ms) to move time forward and trigger any pending timeouts.

Extends

Properties

advance

readonly advance: (duration: Duration) => void;

Defined in: packages/common/src/Time.ts:80

Advances time by the specified duration, triggering pending timeouts.

clearTimeout

readonly clearTimeout: (id: TimeoutId) => void;

Defined in: packages/common/src/Time.ts:33

Cancels a timeout scheduled with Time.setTimeout.

Inherited from

Time.clearTimeout


now

readonly now: () => number & Brand<"Int"> & Brand<"NonNegative"> & Brand<"LessThan281474976710655"> & Brand<"Millis">;

Defined in: packages/common/src/Time.ts:24

Returns current time as Unix epoch milliseconds.

Inherited from

Time.now


nowDateIso

readonly nowDateIso: () => string & Brand<"DateIso">;

Defined in: packages/common/src/Time.ts:27

Returns current time as an ISO 8601 UTC string.

Inherited from

Time.nowDateIso


setTimeout

readonly setTimeout: (fn: () => void, delay: Duration) => TimeoutId;

Defined in: packages/common/src/Time.ts:30

Schedules a callback after the specified delay.

Inherited from

Time.setTimeout