UNPKG

@techmely/utils

Version:

Collection of helpful JavaScript / TypeScript utils

15 lines (12 loc) 454 B
import { convertHrTime } from './chunk-55S7JK54.mjs'; // src/timeSpan.ts function timeSpan() { const start = process.hrtime.bigint(); const end = (type) => convertHrTime(process.hrtime.bigint() - start)[type]; const result = () => end("milliseconds"); result.toRounded = () => Math.round(end("milliseconds")); result.toSeconds = () => end("seconds"); result.toNanoseconds = () => end("nanoseconds"); return result; } export { timeSpan };