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.

Syntax

myPerf = performance.toJSON()

Arguments

None
 

Return value

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

Example

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

Specifications

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
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic supportChrome No support NoEdge Full support YesFirefox Full support 25IE ? Opera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile Full support YesFirefox Android Full support 25Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?

Legend

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

Document Tags and Contributors

Last updated by: chrisdavidmills,