UNPKG

@bolt/build-tools

Version:

Curated collection of front-end build tools in the Bolt Design System.

26 lines (21 loc) 489 B
const convertHrtime = require('convert-hrtime'); const prettyMs = require('pretty-ms'); function start() { return process.hrtime(); } function end(startTime, showMilliseconds = true) { const diff = convertHrtime(process.hrtime(startTime)); if (showMilliseconds) { return prettyMs(diff.milliseconds, { secondsDecimalDigits: 1, }); } else { return prettyMs(diff.milliseconds, { secondsDecimalDigits: 0, }); } } module.exports = { start, end, };