const isRenderTime = Boolean(entry.renderTime);PerformanceElementTiming: renderTime property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
<img
src="image.jpg"
alt="a nice image"
elementtiming="big-image"
id="myImage" />const observer = new PerformanceObserver((list) => {
list.getEntries().forEach((entry) => {
if (entry.identifier === "big-image") {
console.log(entry.renderTime);
}
});
});
observer.observe({ type: "element", buffered: true });