sandpit
Version:
A playground for creative coding using JavaScript and the canvas element
27 lines (21 loc) • 646 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
/**
* Performance shim, as jsdom doesn't ship with it -
* primarily for use in the test suites
* Credit: https://gist.github.com/paulirish/5438650
* @private
*/
var performance = window.performance === undefined ? {} : window.performance;
if (performance && performance.now === undefined) {
var nowOffset = Date.now();
if (performance.timing && performance.timing.navigationStart) {
nowOffset = performance.timing.navigationStart;
}
performance.now = function now() {
return Date.now() - nowOffset;
};
}
exports.performance = performance;