Skip to content

Commit

Permalink
Fix performance.now() polyfill (#763)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicjansma authored and Rycochet committed Mar 17, 2017
1 parent c8eb3e6 commit 8d03682
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions velocity.js
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,8 @@
var performance = (function() {
var perf = window.performance || {};

if (!Object.prototype.hasOwnProperty.call(perf, "now")) {
var nowOffset = perf.timing && perf.timing.domComplete ? perf.timing.domComplete : (new Date()).getTime();
if (typeof perf.now !== "function") {
var nowOffset = perf.timing && perf.timing.navigationStart ? perf.timing.navigationStart : (new Date()).getTime();

perf.now = function() {
return (new Date()).getTime() - nowOffset;
Expand Down

0 comments on commit 8d03682

Please sign in to comment.