window.performance.now polyfill
shims window.performance.now so that it works in all brwosers
JavaScript
//Date.now() wasn't added to the JavaScript spec until ECMAScript 5 so this is needed for <=IE8
Date.now = Date.now || function() { return +new Date; };
//Good browsers support window.performance but shitsters like IE and Safari do not
window.performance = (window.performance || {
offset: Date.now(),
now: function now(){
return Date.now() - this.offset;
}
});
//EG
alert(window.performance.toJSON());