nooschain / time/clock / ManualClock
Class: ManualClock
Defined in: time/clock.ts:37
Mutable clock used by tests and dev verification scripts.
Implements
Constructors
Constructor
new ManualClock(
initial?):ManualClock
Defined in: time/clock.ts:41
Creates a manual clock at the provided time, defaulting to now.
Parameters
initial?
string | number | Date
Returns
ManualClock
Methods
advanceMs()
advanceMs(
ms):void
Defined in: time/clock.ts:61
Advances the manual clock by a number of milliseconds.
Parameters
ms
number
Returns
void
now()
now():
Date
Defined in: time/clock.ts:46
Returns a Date for the current manual timestamp.
Returns
Date
Implementation of
nowIso()
nowIso():
string
Defined in: time/clock.ts:56
Returns the current manual timestamp as an ISO string.
Returns
string
Implementation of
nowMs()
nowMs():
number
Defined in: time/clock.ts:51
Returns the current manual timestamp as epoch milliseconds.
Returns
number
Implementation of
set()
set(
value):void
Defined in: time/clock.ts:66
Sets the manual clock to a Date, ISO/date string, or epoch millisecond value.
Parameters
value
string | number | Date
Returns
void