/
index.md
41 lines (31 loc) · 1.31 KB
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
title: "RTCIceCandidatePairStats: totalRoundTripTime property"
short-title: totalRoundTripTime
slug: Web/API/RTCIceCandidatePairStats/totalRoundTripTime
page-type: web-api-instance-property
browser-compat: api.RTCStatsReport.type_candidate-pair.totalRoundTripTime
---
{{APIRef("WebRTC")}}
The {{domxref("RTCIceCandidatePairStats")}} dictionary's
**`totalRoundTripTime`** property is the total time that has
elapsed between sending {{Glossary("STUN")}} requests and receiving the responses, for
all such requests that have been made so far on the pair of candidates described by
this `RTCIceCandidatePairStats` object. This value includes both
connectivity check and consent check requests.
## Value
This floating-point value indicates the total number of seconds which have elapsed
between sending out STUN connectivity and consent check requests and receiving their
responses, for all such requests made so far on the connection described by this
candidate pair.
You can calculate the average round-trip time (RTT) by dividing this value by the value
of the {{domxref("RTCIceCandidatePairStats.responsesReceived", "responsesReceived")}}
property:
```js
rtt =
rtcIceCandidatePairStats.totalRoundTripTime /
rtcIceCandidatePairStats.responsesReceived;
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}