performance.mark("debug-marker", {
detail: "debugging-marker-123",
});
const observer = new PerformanceObserver((list) => {
list.getEntries().forEach((entry) => {
const json = entry.toJSON();
console.log(json); // A plain object
console.log(typeof json); // "object"
console.log(json.name); // Same value as entry.name
});
});
observer.observe({ type: "mark", buffered: true });PerformanceEntry: toJSON() method / notebook
PerformanceEntry: toJSON() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
console.log(JSON.stringify(entry));