Forked from paulirish/performance.now()-polyfill.js
Last active
July 8, 2016 10:52
-
-
Save yesasha/1f4039070fab3c449900 to your computer and use it in GitHub Desktop.
performance.now() and performance.timing.navigationStart polyfill
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// performance.now() and performance.timing.navigationStart polyfill | |
if (!window.performance) { | |
window.performance = {}; | |
} | |
if (!performance.now) { | |
performance.now = function () { | |
return Date.now() - this.timing.navigationStart; | |
} | |
} | |
if (!performance.timing) { | |
performance.timing = {}; | |
} | |
if (!performance.timing.navigationStart) { | |
performance.timing.navigationStart = Date.now(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment