Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. EventCounts

EventCounts

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

TheEventCounts interface of thePerformance API provides the number of events that have been dispatched for each event type.

AnEventCounts instance is a read-onlyMap-like object, in which each key is the name string for an event type, and the corresponding value is an integer indicating the number of events that have been dispatched for that event type.

Constructor

This interface has no constructor. You typically get an instance of this object using theperformance.eventCounts property.

Instance properties

size

SeeMap.prototype.size for details.

Instance methods

entries()

SeeMap.prototype.entries() for details.

forEach()

SeeMap.prototype.forEach() for details.

get()

SeeMap.prototype.get() for details.

has()

SeeMap.prototype.has() for details.

keys()

SeeMap.prototype.keys() for details.

values()

SeeMap.prototype.values() for details.

Examples

Working with EventCount maps

Below are a few examples to get information from anEventCounts map. Note that the map is read-only and theclear(),delete(), andset() methods aren't available.

js
for (entry of performance.eventCounts.entries()) {  const type = entry[0];  const count = entry[1];}const clickCount = performance.eventCounts.get("click");const isExposed = performance.eventCounts.has("mousemove");const exposedEventsCount = performance.eventCounts.size;const exposedEventsList = [...performance.eventCounts.keys()];

Specifications

Specification
Event Timing API
# sec-event-counts

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp