0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-11-27 09:50:52 -05:00

fixed Common.now, closes #55

This commit is contained in:
liabru 2015-05-20 23:12:26 +01:00
parent 41b4b7f610
commit 8555c0c671

View file

@ -213,15 +213,19 @@ var Common = {};
Common.now = function() { Common.now = function() {
// http://stackoverflow.com/questions/221294/how-do-you-get-a-timestamp-in-javascript // http://stackoverflow.com/questions/221294/how-do-you-get-a-timestamp-in-javascript
// https://gist.github.com/davidwaterston/2982531 // https://gist.github.com/davidwaterston/2982531
var perf = window.performance;
if (perf) { var performance = window.performance || {};
perf.now = perf.now || perf.webkitNow || perf.msNow || perf.oNow || perf.mozNow;
return +(perf.now()); performance.now = (function() {
} return performance.now ||
performance.webkitNow ||
return +(new Date()); performance.msNow ||
performance.oNow ||
performance.mozNow ||
function() { return +(new Date()); };
})();
return performance.now();
}; };