Is the time between the attribute window.performance.timing.connecStart
and window.performance.timing.loadEventStart
the time it took for the window.onload
event to fire? I mean, from the connection until the callback of onload
is executed?
I have the following function (it's part of a small lib of mine):
pageLoad: function() {
var start, end, total;
start = window.performance.timing.connectStart;
end = window.performance.timing.loadEventStart;
total = end - start;
console.log(total + "ms para disparar o evento window.onload");
return total;
}
Is this function accurately picking up the connection interval until the window.onload
event is triggered? If not, how could I do this?