ReadonlynowHow many times now has been read.
ReadonlypendingSleeps still waiting for time to advance.
ReadonlysleepsDurations passed to sleep, in call order.
Move time forward by ms, settling every sleep that comes due, then drain the queue.
A signal that aborts once ms have elapsed on this clock.
dispose() releases the underlying timer; call it when the guarded work finishes
early, or a long deadline keeps a handle alive for its full duration.
Current wall-clock time in epoch milliseconds.
Resolve after ms have elapsed on this clock.
Rejects with the signal's reason if signal aborts first, so a caller can cancel a
wait without leaving the timer behind.
An injected implementation must not resolve synchronously. The worker schedules its next poll by awaiting this, so a sleep that settles in a microtask turns the poll loop into an unbounded spin that starves the event loop and exhausts the heap. A test clock should resolve only when the test advances it.
Optionalsignal: AbortSignal
A
Clockwhose time only moves when the test says so, plus the counters a test needs to assert on. Everything beyondClockis inspection or control, never behaviour the SDK depends on.