This repository has been archived by the owner on Oct 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
sp core library.itimeprovider
John Nguyen edited this page Apr 22, 2021
·
2 revisions
Home > @microsoft/sp-core-library > ITimeProvider
This is a ServiceScope contract for reading the system clock.
Signature:
export interface ITimeProvider
This interface abstracts the functionality of the system time APIs for usage with a ServiceScope. For example, a unit test might replace the default TimeProvider service with a mock implementation that follows a manually incremented timeline, in order to ensure that test failures are always repeatable.
Method | Description |
---|---|
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. |