Хабр Курсы для всех
РЕКЛАМА
Практикум, Хекслет, SkyPro, авторские курсы — собрали всех и попросили скидки. Осталось выбрать!
<html>
<head>
</head>
<body onload="allContentLoaded()">
<!-- Page's content here-->
<script>
var time1 = 0;
var time2 = 0;
function microtime(get_as_float) {
var now = new Date().getTime() / 1000;
var s = parseInt(now);
return (get_as_float) ? now : (Math.round((now - s) * 1000) / 1000) + ' ' + s;
}
if (document.addEventListener) {
document.addEventListener("DOMContentLoaded", DOMContentLoaded, false);
}
function allContentLoaded() {
time2 = microtime(true);
res = parseFloat(time2 - time1).toFixed(3);
alert(res);
}
function DOMContentLoaded() {
time1 = microtime(true);
}
</script>
</body>
</html>
* This source code was highlighted with Source Code Highlighter.
Проверка включенного кэширования у браузера