TimeProvider class

This is the default implementation of ITimeProvider that simply calls the real browser APIs.

Implements

Constructors

(constructor)(serviceScope)

Constructs a new instance of the TimeProvider class

Properties

serviceKey

The service key for ITimeProvider.

Methods

getDate()

Returns the current date/time, similar to the Date class constructor.

getTimestamp()

Returns a DOMHighResTimeStamp timing measurement, as defined by the standard performance.now() API.

Constructor Details

(constructor)(serviceScope)

Constructs a new instance of the TimeProvider class

constructor(serviceScope: ServiceScope);

Parameters

serviceScope
ServiceScope

Property Details

serviceKey

The service key for ITimeProvider.

static readonly serviceKey: ServiceKey<ITimeProvider>;

Property Value

ServiceKey<ITimeProvider>

Method Details

getDate()

Returns the current date/time, similar to the Date class constructor.

getDate(): Date;

Returns

Date

getTimestamp()

Returns a DOMHighResTimeStamp timing measurement, as defined by the standard performance.now() API.

getTimestamp(): number;

Returns

number