Performance
interface
interface PerformanceEnde supports User Timing Level 3 which is not widely supported yet in other runtimes.
Check out the Performance API documentation on MDN for further information about how to use the API.
interface
interface Performance extends EventTargetvariable
var Performance: { … }The constructor object for Performance.
The Performance instance is accessed via the global performance
property rather than constructed directly, so calling the constructor throws.
Constructors
constructor
new Performance(): neverProperties
timeOrigin
readonly timeOrigin: numberReturns a timestamp representing the start of the performance measurement.
prototype
readonly prototype: PerformanceMethods
mark
mark(markName: string, options?: PerformanceMarkOptions): PerformanceMarkStores a timestamp with the associated name (a "mark").
mark(markName: string, options?: PerformanceMarkOptions): PerformanceMarkStores a timestamp with the associated name (a "mark").
measure
measure(measureName: string, options?: PerformanceMeasureOptions): PerformanceMeasureStores the DOMHighResTimeStamp duration between two marks along with the
associated name (a "measure").
measure(measureName: string, options?: PerformanceMeasureOptions): PerformanceMeasureStores the DOMHighResTimeStamp duration between two marks along with the
associated name (a "measure").
measure(measureName: string, startMark?: string, endMark?: string): PerformanceMeasureStores the DOMHighResTimeStamp duration between two marks along with the
associated name (a "measure").
clearMarks
clearMarks(markName?: string): voidRemoves the stored timestamp with the associated name.
clearMeasures
clearMeasures(measureName?: string): voidRemoves stored timestamp with the associated name.
clearResourceTimings
clearResourceTimings(): voidRemoves all performance entries with an entryType of "resource" from the performance timeline and sets the size of the performance resource data buffer to zero.
Note: Ende does not currently track resource timings, so this method has no observable effect. It is provided for API compatibility.
setResourceTimingBufferSize
setResourceTimingBufferSize(maxSize: number): voidSets the desired size of the browser's resource timing buffer which stores the "resource" performance entries.
Note: Ende does not currently track resource timings, so this method has no observable effect. It is provided for API compatibility.
getEntries
getEntries(): PerformanceEntryListgetEntriesByName
getEntriesByName(name: string, type?: string): PerformanceEntryListgetEntriesByType
getEntriesByType(type: string): PerformanceEntryListnow
now(): numberReturns a current time from Ende's start in fractional milliseconds.
const t = performance.now();
console.log(`${t} ms since start!`);
toJSON
toJSON(): anyReturns a JSON representation of the performance object.
performance
variable
var performance: PerformanceThe global Performance instance, providing access to
high-resolution timing via performance.now() and the user-timing marks and
measures APIs.