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 Aug 2, 2020
1 parent 8795f0e commit 06eb066
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/velocity/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 06eb066

Please sign in to comment.