Lox Nexus

Class: SystemClock

The real clock. It looks the globals up on every call, so tests that use mock.timers still work.

Implements

Constructors

Constructor

new SystemClock(): SystemClock

Returns

SystemClock

Properties

instance

readonly static instance: SystemClock

Methods

now()

now(): number

milliseconds since the epoch, like Date.now()

Returns

number

Implementation of

Clock.now


setTimeout()

setTimeout(fn, ms): Timeout

like the global setTimeout; the handle is only meant for clearTimeout

Parameters

fn

() => void

ms

number

Returns

Timeout

Implementation of

Clock.setTimeout


clearTimeout()

clearTimeout(handle): void

Parameters

handle

unknown

Returns

void

Implementation of

Clock.clearTimeout


setInterval()

setInterval(fn, ms): Timeout

like the global setInterval; the handle is only meant for clearInterval

Parameters

fn

() => void

ms

number

Returns

Timeout

Implementation of

Clock.setInterval


clearInterval()

clearInterval(handle): void

Parameters

handle

unknown

Returns

void

Implementation of

Clock.clearInterval