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
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
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
performance.toJSON() by Mozilla Contributors is licensed under CC-BY-SA 2.5.