duration.js
This file
Path
lib/return/duration.js
8 lines · 313 bytes · JavaScript
Last changed by
Add more code comments (#984)ehmickybefore adoptionfdd8a9f
History of this fileTake it
123456789import {hrtime} from 'node:process';
// Start counting time before spawning the subprocessexport const getStartTime = () => hrtime.bigint();
// Compute duration after the subprocess ended.// Printed by the `verbose` option.export const getDurationMs = startTime => Number(hrtime.bigint() - startTime) / 1e6;