I am working on detecting the connection speed, so i planned to go with window.performance object for duration calculation.
I am little confused with window.performance.timing object is generated based on the whole page load, or based on the last request and response.
For Example:
I am having 5 server call for web page load, performance.timing object is generated based on all the 5 server calls or based on the 5th server call(last call).
sample connection speed calculation for reference
var bitsLoaded = 100000; //bits total size of all files (5 server call).
var duration = performance.timing.responseEnd - performance.timing.navigationStart;
var speedBps = Math.round(bitsLoaded / duration);
var speedKbps = (speedBps / 1024).toFixed(2);
var speedMbps = (speedKbps / 1024).toFixed(2);
Anything not clear ready to explain
Any idea about window.performance
