Performance

The Performance interface provides access to performance-related information for the current page.

MDN Reference

Properties

Link copied to clipboard

The read-only performance.eventCounts property is an EventCounts map containing the number of events which have been dispatched per event type.

Link copied to clipboard

The timeOrigin read-only property of the Performance interface returns the high resolution timestamp that is used as the baseline for performance-related timestamps.

Functions

Link copied to clipboard
fun clearMarks(markName: String = definedExternally)

The clearMarks() method removes all or specific PerformanceMark objects from the browser's performance timeline.

Link copied to clipboard
fun clearMeasures(measureName: String = definedExternally)

The clearMeasures() method removes all or specific PerformanceMeasure objects from the browser's performance timeline.

Link copied to clipboard

The clearResourceTimings() method removes all performance entries with an PerformanceEntry.entryType of 'resource' from the browser's performance timeline and sets the size of the performance resource data buffer to zero.

Link copied to clipboard
Link copied to clipboard

The getEntries() method returns an array of all PerformanceEntry objects currently present in the performance timeline.

Link copied to clipboard
fun getEntriesByName(name: String, type: String = definedExternally): PerformanceEntryList

The getEntriesByName() method returns an array of PerformanceEntry objects currently present in the performance timeline with the given name and type.

Link copied to clipboard

The getEntriesByType() method returns an array of PerformanceEntry objects currently present in the performance timeline for a given type.

Link copied to clipboard
fun mark(markName: String, markOptions: PerformanceMarkOptions = definedExternally): PerformanceMark

The mark() method creates a named PerformanceMark object representing a high resolution timestamp marker in the browser's performance timeline.

Link copied to clipboard
fun measure(measureName: String, startOrMeasureOptions: String = definedExternally, endMark: String = definedExternally): PerformanceMeasure

The measure() method creates a named PerformanceMeasure object representing a time measurement between two marks in the browser's performance timeline.

fun measure(    measureName: String,     startOrMeasureOptions: PerformanceMeasureOptions,     endMark: String = definedExternally): PerformanceMeasure
Link copied to clipboard

The performance.now() method returns a high resolution timestamp in milliseconds.

Link copied to clipboard

The setResourceTimingBufferSize() method sets the desired size of the browser's resource timing buffer which stores the 'resource' performance entries.

Link copied to clipboard
fun toJSON(): JsAny

The toJSON() method of the Performance interface is a Serialization; it returns a JSON representation of the Performance object.

Link copied to clipboard
fun <T : Event> when(type: EventType<T>, options: ObservableEventListenerOptions? = definedExternally): Observable<T>