Page load time with JavaScript

前端 未结 6 2370
梦谈多话
梦谈多话 2020-12-23 17:27

I am looking for a proper way to test the time it takes a page to fully load all its resources. What I\'ve done so far is add:

window.startTime = (new Date).         


        
6条回答
  •  太阳男子
    2020-12-23 18:09

    type this on your browser console:

    var loadTime = window.performance.timing.domContentLoadedEventEnd- window.performance.timing.navigationStart;
    loadTime;
    

提交回复
热议问题