@splitsoftware/splitio-commons
Version:
Split JavaScript SDK common components
16 lines (15 loc) • 505 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.now = void 0;
// Can be used on any runtime, since it fallbacks to `Date.now` if `performance.now` is not available
function nowFactory() {
// eslint-disable-next-line
if (typeof performance === 'object' && typeof performance.now === 'function') {
// eslint-disable-next-line
return performance.now.bind(performance);
}
else {
return Date.now;
}
}
exports.now = nowFactory();
;