Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. PerformanceElementTiming
  4. loadTime

PerformanceElementTiming: loadTime property

Limited availability

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

Experimental:This is anexperimental technology
Check theBrowser compatibility table carefully before using this in production.

TheloadTime read-only property of thePerformanceElementTiming interface always returns0 for text. For images it returns the time which is the latest between the time the image resource is loaded and the time it is attached to the element.

Value

ADOMHighResTimeStamp with theloadTime of the element. Always0 for text.

Examples

LoggingloadTime

In this example an<img> element is being observed by adding theelementtiming attribute. APerformanceObserver is registered to get all performance entries of type"element". Thebuffered flag is used to access data from before the observer was created. Callingentry.loadTime returns the loadTime of the image element.

html
<img  src="image.jpg"  alt="a nice image"  elementtiming="big-image"  />
js
const observer = new PerformanceObserver((list) => {  list.getEntries().forEach((entry) => {    if (entry.identifier === "big-image") {      console.log(entry.loadTime);    }  });});observer.observe({ type: "element", buffered: true });

Specifications

Specification
Element Timing API
# dom-performanceelementtiming-loadtime

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp