igir
Version:
🕹 A zero-setup ROM collection manager that sorts, filters, extracts or archives, patches, and reports on collections of any size on any OS.
15 lines (14 loc) • 454 B
JavaScript
export default {
hrtimeMillis(timeMillis) {
const hrtime = timeMillis === undefined
? undefined
: [
// ms -> s
Math.floor(timeMillis / 1000),
// ms -> ns
(timeMillis - Math.floor(timeMillis / 1000) * 1000) * 1_000_000,
];
const [sec, nano] = process.hrtime(hrtime);
return sec * 1000 + Math.floor(nano / 1_000_000);
},
};