Web/API/Performance/toJSON

From Get docs


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 2The definition of 'toJSON() serializer' in that specification. Recommendation Defines toJson().

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
toJSON Chrome

Full support 56

Edge

Full support 12

Firefox

Full support 25

IE

?

Opera

No support No

Safari

No support No

WebView Android

Full support 56

Chrome Android

Full support 56

Firefox Android

Full support 25

Opera Android

No support No

Safari iOS

No support No

Samsung Internet Android

Full support 6.0

Legend

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