Get to know MDN better
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The toJSON() method of the PerformanceLongTaskTiming interface is a serializer; it returns a JSON representation of the PerformanceLongTaskTiming object.
None.
A JSON object that is the serialization of the PerformanceLongTaskTiming object.
In this example, calling entry.toJSON() returns a JSON representation of the PerformanceLongTaskTiming object.
This would log a JSON object like so:
To get a JSON string, you can use JSON.stringify(entry) directly; it will call toJSON() automatically.
| Long Tasks API # dom-performancelongtasktiming-tojson |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Apr 7, 2023 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.