Search code examples
javascriptperformancepageload

What is a reliable way to calculate actual (web) page loadtime


I'm interested in knowing the actual average page loadtime for my webapplication.

Simplistically, how log does my average visitor wait before they can start using a page on my site. From when they click the link to my site until the site is finished rendering & ready to accept input.

The standard solution seems to be to use Javascript to compare the time from a script in the until a script in the window.onload() event.

(See: http://www.dreamincode.net/code/snippet1908.htm)

This doesn't seem like a very acturate measure to me, as it ignores the time taken to resolve my domain & receive enough HTML content to begin Javascript parsig.

It also looks like Safari fires window.onload before the page has actually finished loading (http://www.howtocreate.co.uk/safaribenchmarks.html).

Any ideas?

Is it possible to get the time a the current request was initiated via Javascript?
What event fires after everything is ready reliably across all browsers?


Solution

  • http://www.webpagetest.org/ is an excellent resource for measuring load time

    Also google chorme dev tools has a Timeline panel where you can record events, Here is a 2.5minute video showing you how Timeline in google chrome works http://www.youtube.com/watch?v=RhaWYQ44WEc