If you don't need to support it in all/old browsers, you should check out the relatively new Navigation Timing API:
https://developer.mozilla.org/en-US/docs/Navigation_timing
Straight from the examples:
Calculate the total time required to load a page:
var perfData = window.performance.timing;
var pageLoadTime = perfData.loadEventEnd – perfData.navigationStart;
~~James