Emulate window.performance.timing on Safari and <IE9

what's the best way to go about getting page load performance in Safari and

Most other browsers support the window.performance.timing object, which is great for this kind of thing.

I obviously can't get all the information it provides, but as much of it as possible would be useful.

One thing to note is that the script may not always be in the ideal position of first script loaded in the HEAD tag

Thanks in advance!

Answers


There's no real way of polyfilling the data that window.performance.timing can provide, but there are a couple of things you can do.

  1. Create a timestamp in the header, and then another during onload, DOM Content Loaded or another event and record the differences between the two.

  2. You could also insert the timestamp on the server side but then there's the danger of the client and server clocks being out of step

  3. User timing can be polyfilled, Pat Meenan talks about his - http://blog.patrickmeenan.com/2013/07/measuring-performance-of-user-experience.html


Need Your Help

IOS InAppPurchase content download from my own server

ios iphone in-app-purchase

I am developing an application. In this application new user will get access to download three images from my own PHP server. After downloading 2 images he then needs to purchase subscription for (...

How to listen Zoom in/out event of WKWebView

ios swift wkwebview

I want to hide/show navigationBar of a UINavigationController when the WKWebView zooms out/in.