0

I want to log my page's perceived loading time(the milliseconds from the user refresh the page to the custom-finish-loading event).
somehow, I can get the custom-finish-loading event. in the event handler I want to log the elapsed time from "the time when user refreshing the page" to the "current time". something like:

document.on("custom-finish-loading", function() {
    console.log(getElapsedTimeFromRefreshingPage());
});

I want to know if the browser provide such a function like getElapsedTimeFromRefreshingPage() to get the elapsed time from refreshing the page?

Freedom
  • 773
  • 9
  • 26
  • Actually, not exactly sure if this is what you're looking for, but you may find an answer here: http://stackoverflow.com/questions/14341156/calculating-page-load-time-in-javascript . Take a closer look to the second answer by HaNdTriX, there is a full list of events that may help you accomplishing everything. More infos can be found here: http://msdn.microsoft.com/en-US/en-en/library/ie/hh673552%28v=vs.85%29.aspx – briosheje Oct 16 '14 at 09:32
  • @briosheje yes, that is the awnser! thanks – Freedom Oct 16 '14 at 13:10

0 Answers0