1
The time between the attribute window.performance.timing.connecStart and window.performance.timing.loadEventStart would be the time it took for the event window.onload was fired? I mean, from the connection to the callback of onload be executed?
I have the following function (it is part of a little 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;
}
This function is accurately picking the connection interval up to the event window.onload be fired? If not, in what way could I do it?
From the MDN documentation it seems to be just that. There are some caveats about the value of
connectStartwhen the connection is pre-established, but I don’t think it interferes with your logic.– Woss