API reference › @evolu/common › Time › testCreateTime
function testCreateTime(options?: {
autoIncrement?: boolean;
startAt?: number &
Brand<"Int"> &
Brand<"NonNegative"> &
Brand<"LessThan281474976710655"> &
Brand<"Millis">;
}): TestTime;
Defined in: packages/common/src/Time.ts:98
Creates a TestTime with controllable timers for testing.
Time starts at startAt (default 0) and only advances when advance() is
called. Timeouts scheduled via setTimeout fire when time is advanced past
their deadline.
Set autoIncrement to automatically increment time by 1ms after each now()
call via microtask (useful for tests that need monotonically increasing
values without explicit advance() calls).