var t1 = new Date().getTime(); window.onload = function() { alert("加载本页耗时 " + (new Date().getTime() - t1)/1000 + "秒") }