Files
portfolio2023/build/node_modules/time-span/index.js
T
2023-11-24 22:35:41 +01:00

15 lines
421 B
JavaScript

'use strict';
const convertHrtime = require('convert-hrtime');
module.exports = () => {
const start = process.hrtime();
const end = type => convertHrtime(process.hrtime(start))[type];
const returnValue = () => end('milliseconds');
returnValue.rounded = () => Math.round(end('milliseconds'));
returnValue.seconds = () => end('seconds');
returnValue.nanoseconds = () => end('nanoseconds');
return returnValue;
};