You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.0 KiB
JavaScript
37 lines
1.0 KiB
JavaScript
6 years ago
|
// Generated by CoffeeScript 1.12.2
|
||
|
(function() {
|
||
|
var getNanoSeconds, hrtime, loadTime, moduleLoadTime, nodeLoadTime, upTime;
|
||
|
|
||
|
if ((typeof performance !== "undefined" && performance !== null) && performance.now) {
|
||
|
module.exports = function() {
|
||
|
return performance.now();
|
||
|
};
|
||
|
} else if ((typeof process !== "undefined" && process !== null) && process.hrtime) {
|
||
|
module.exports = function() {
|
||
|
return (getNanoSeconds() - nodeLoadTime) / 1e6;
|
||
|
};
|
||
|
hrtime = process.hrtime;
|
||
|
getNanoSeconds = function() {
|
||
|
var hr;
|
||
|
hr = hrtime();
|
||
|
return hr[0] * 1e9 + hr[1];
|
||
|
};
|
||
|
moduleLoadTime = getNanoSeconds();
|
||
|
upTime = process.uptime() * 1e9;
|
||
|
nodeLoadTime = moduleLoadTime - upTime;
|
||
|
} else if (Date.now) {
|
||
|
module.exports = function() {
|
||
|
return Date.now() - loadTime;
|
||
|
};
|
||
|
loadTime = Date.now();
|
||
|
} else {
|
||
|
module.exports = function() {
|
||
|
return new Date().getTime() - loadTime;
|
||
|
};
|
||
|
loadTime = new Date().getTime();
|
||
|
}
|
||
|
|
||
|
}).call(this);
|
||
|
|
||
|
//# sourceMappingURL=performance-now.js.map
|