To count the DOM loading time in Javascript you can use the following snippet.

Sample Javascript

var dateBefore = new Date();

window.onload = function() {
document.getElementById("aDivId").innerHTML = (new Date()).getTime() - dateBefore.getTime(); 	
}

2 thought on “How to count the DOM loading time in Javascript”

Leave a Reply