The toJSON() method of the Performance interface is a standard serializer: it returns a JSON representation of the performance object's properties.

Note: This feature is available in Web Workers.


myPerf = performance.toJSON()



Return value

A JSON object that is the serialization of the Performance object.


var js;
js = window.performance.toJSON();
console.log("json = " + JSON.stringify(js));


Specification Status Comment
High Resolution Time Level 2
The definition of 'toJSON() serializer' in that specification.
Candidate Recommendation Defines toJson().

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic supportChrome Full support 65Edge Full support YesFirefox Full support 25IE ? Opera No support NoSafari No support NoWebView Android Full support 65Chrome Android Full support 65Edge Mobile Full support YesFirefox Android Full support 25Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?


Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown

Document Tags and Contributors

Last updated by: chrisdavidmills,