if (rtcStats && rtcStats.type === "candidate-pair") {
let elapsed =
(rtcStats.lastRequestTimestamp - rtcStats.firstRequestTimestamp) /
rtcStats.requestsSent;
console.log(`Average time between ICE connectivity checks: ${elapsed} ms.`);
}RTCIceCandidatePairStats / notebook
RTCIceCandidatePairStats
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.