Performance

interface

interface Performance

Ende 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 EventTarget

variable

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(): never

Properties

timeOrigin

readonly timeOrigin: number

Returns a timestamp representing the start of the performance measurement.

prototype

readonly prototype: Performance

Methods

mark

mark(markName: string, options?: PerformanceMarkOptions): PerformanceMark

Stores a timestamp with the associated name (a "mark").

mark(markName: string, options?: PerformanceMarkOptions): PerformanceMark

Stores a timestamp with the associated name (a "mark").

measure

measure(measureName: string, options?: PerformanceMeasureOptions): PerformanceMeasure

Stores the DOMHighResTimeStamp duration between two marks along with the associated name (a "measure").

measure(measureName: string, options?: PerformanceMeasureOptions): PerformanceMeasure

Stores the DOMHighResTimeStamp duration between two marks along with the associated name (a "measure").

measure(measureName: string, startMark?: string, endMark?: string): PerformanceMeasure

Stores the DOMHighResTimeStamp duration between two marks along with the associated name (a "measure").

clearMarks

clearMarks(markName?: string): void

Removes the stored timestamp with the associated name.

clearMeasures

clearMeasures(measureName?: string): void

Removes stored timestamp with the associated name.

clearResourceTimings

clearResourceTimings(): void

Removes 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): void

Sets 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(): PerformanceEntryList

getEntriesByName

getEntriesByName(name: string, type?: string): PerformanceEntryList

getEntriesByType

getEntriesByType(type: string): PerformanceEntryList

now

now(): number

Returns a current time from Ende's start in fractional milliseconds.

const t = performance.now();
console.log(`${t} ms since start!`);

toJSON

toJSON(): any

Returns a JSON representation of the performance object.

performance

variable

var performance: Performance

The global Performance instance, providing access to high-resolution timing via performance.now() and the user-timing marks and measures APIs.