页面加载用时

(function(){
  const t = window.performance && performance.timing;
  if (!t) {
    return;
  }
  const loadTime = (t.loadEventEnd - t.navigationStart) / 1000;
  alert(`This page loaded in ${loadTime} seconds`);
}())

来源

你可能感兴趣的:(页面加载用时)