Skip to content

Instantly share code, notes, and snippets.

View SindreSvendby's full-sized avatar

Sindre Svendby SindreSvendby

  • Oslo, Norway
  • 01:23 (UTC +02:00)
View GitHub Profile
@SindreSvendby
SindreSvendby / performance.now.polyfill.js
Created July 8, 2016 10:52 — forked from yesasha/performance.now.polyfill.js
performance.now() and performance.timing.navigationStart polyfill
// performance.now() and performance.timing.navigationStart polyfill
if (!window.performance) {
window.performance = {};
}
if (!performance.now) {
performance.now = function () {
return Date.now() - this.timing.navigationStart;
}
}
@SindreSvendby
SindreSvendby / performance.now()-polyfill.js
Last active July 8, 2016 11:00 — forked from paulirish/performance.now()-polyfill.js
performance.now() polyfill (aka perf.now())
// @license http://opensource.org/licenses/MIT
// copyright Paul Irish 2015
// Date.now() is supported everywhere except IE8. For IE8 we use the Date.now polyfill
// github.com/Financial-Times/polyfill-service/blob/master/polyfills/Date.now/polyfill.js
// as Safari 6 doesn't have support for NavigationTiming, we use a Date.now() timestamp for relative values
// if you want values similar to what you'd get with real perf.now, place this towards the head of the page
// but in reality, you're just getting the delta between now() calls, so it's not terribly important where it's placed
.DS_Store
Gemfile.lock
*.pem
node.json
tmp/*
!tmp/.gitignore
.DS_Store
Gemfile.lock
*.pem
node.json
tmp/*
!tmp/.gitignore