Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
TimeProvider class
- Package:
- @microsoft/sp-core-library
This is the default implementation of ITimeProvider that simply calls the real browser APIs.
Constructors
| (constructor)(serviceScope) | Constructs a new instance of the |
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: IServiceKey<ITimeProvider>;
Property Value
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
