Chartbreaker
    Preparing search index...

    Interface Performance

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

    MDN Reference

    interface Performance {
        eventCounts: EventCounts;
        interactionCount: number;
        navigation: PerformanceNavigation;
        onresourcetimingbufferfull: ((this: Performance, ev: Event) => any) | null;
        timeOrigin: number;
        timing: PerformanceTiming;
        addEventListener<K extends "resourcetimingbufferfull">(
            type: K,
            listener: (this: Performance, ev: PerformanceEventMap[K]) => any,
            options?: boolean | AddEventListenerOptions,
        ): void;
        addEventListener(
            type: string,
            listener: EventListenerOrEventListenerObject,
            options?: boolean | AddEventListenerOptions,
        ): void;
        clearMarks(markName?: string): void;
        clearMeasures(measureName?: string): void;
        clearResourceTimings(): void;
        dispatchEvent(event: Event): boolean;
        getEntries(): PerformanceEntryList;
        getEntriesByName(name: string, type?: string): PerformanceEntryList;
        getEntriesByType(type: string): PerformanceEntryList;
        mark(
            markName: string,
            markOptions?: PerformanceMarkOptions,
        ): PerformanceMark;
        measure(
            measureName: string,
            startOrMeasureOptions?: string | PerformanceMeasureOptions,
            endMark?: string,
        ): PerformanceMeasure;
        now(): number;
        removeEventListener<K extends "resourcetimingbufferfull">(
            type: K,
            listener: (this: Performance, ev: PerformanceEventMap[K]) => any,
            options?: boolean | EventListenerOptions,
        ): void;
        removeEventListener(
            type: string,
            listener: EventListenerOrEventListenerObject,
            options?: boolean | EventListenerOptions,
        ): void;
        setResourceTimingBufferSize(maxSize: number): void;
        toJSON(): any;
    }

    Hierarchy

    • EventTarget
      • Performance
    Index

    Properties

    eventCounts: EventCounts

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

    MDN Reference

    interactionCount: number

    The read-only performance.interactionCount property represents the number of real-user interactions that have occurred on the page since it was loaded.

    MDN Reference

    The legacy Performance.navigation read-only property returns a PerformanceNavigation object representing the type of navigation that occurs in the given browsing context, such as the number of redirections needed to fetch the resource.

    MDN Reference

    onresourcetimingbufferfull: ((this: Performance, ev: Event) => any) | null
    timeOrigin: number

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

    MDN Reference

    The legacy Performance.timing read-only property returns a PerformanceTiming object containing latency-related performance information.

    MDN Reference

    Methods

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

      MDN Reference

      Parameters

      • OptionalmarkName: string

      Returns void

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

      MDN Reference

      Parameters

      • OptionalmeasureName: string

      Returns void

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

      MDN Reference

      Returns void

    • The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().

      MDN Reference

      Parameters

      • event: Event

      Returns boolean

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

      MDN Reference

      Parameters

      • name: string
      • Optionaltype: string

      Returns PerformanceEntryList

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

      MDN Reference

      Parameters

      Returns PerformanceMark

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

      MDN Reference

      Parameters

      Returns PerformanceMeasure

    • The performance.now() method returns a high resolution timestamp in milliseconds. It represents the time elapsed since Performance.timeOrigin (the time when navigation has started in window contexts, or the time when the worker is run in Worker and ServiceWorker contexts).

      MDN Reference

      Returns number

    • The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.

      MDN Reference

      Type Parameters

      • K extends "resourcetimingbufferfull"

      Parameters

      Returns void

    • The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.

      MDN Reference

      Parameters

      Returns void

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

      MDN Reference

      Parameters

      • maxSize: number

      Returns void

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

      MDN Reference

      Returns any