Skip to content

nooschain v0.1.0


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

Clock.now


nowIso()

nowIso(): string

Defined in: time/clock.ts:56

Returns the current manual timestamp as an ISO string.

Returns

string

Implementation of

Clock.nowIso


nowMs()

nowMs(): number

Defined in: time/clock.ts:51

Returns the current manual timestamp as epoch milliseconds.

Returns

number

Implementation of

Clock.nowMs


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

Audience-first NOOSChain documentation.