public
Last active

JS performance timer

  • Download Gist
perfnow.js
JavaScript
1 2 3 4 5 6 7 8 9 10
var perfnow = (function() {
return (
(performance && performance.now) ? function() { return performance.now(); }
: (performance && performance.webkitNow) ? function() { return performance.webkitNow(); }
: (performance && performance.mozNow) ? function() { return performance.mozNow(); }
: (performance && performance.oNow) ? function() { return performance.oNow(); }
: (Date.now) ? function() { return Date.now(); }
: function() { return +new Date(); }
)
}());

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.