---
title: PerformanceServerTiming.toJSON
slug: Web/API/PerformanceServerTiming/toJSON
tags:
  - API
  - Method
  - PerformanceServerTiming
  - Reference
  - ServerTiming
  - toJSON
browser-compat: api.PerformanceServerTiming.toJSON
---
{{APIRef("Resource Timing API")}}

The **`toJSON()`** method of the
{{domxref("PerformanceServerTiming")}} interface returns a {{domxref("DOMString")}} that
is the JSON representation of the {{domxref('PerformanceServerTiming')}} object.

## Syntax

```js
var json = PerformanceServerTiming.toJSON()
```

### Parameters

None.

### Return value

A {{domxref('DomString')}} containing JSON.

### Exceptions

None.

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}
