生产环境可以使用更复杂的解决方案。但是对于开发人员我这样做了:
localStorage["markTime"] = new Date().getTime();
window.location.href = window.location.href + "dev"
// browser goes off and gets new page but we have a local time where this started
<script> <!-- first line after the head tag (forgetting meta data, etc) -->
alert(new Date().getTime() - localStorage["markTime"] + "ms");
</script>
这是否给出了下载页面所需时间的准确数字?