Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return (val) => {
const endTime = new Date();
const duration = ms(endTime - startTime);
logTime(endTime, `Finished '${cyan(name)}' (${magenta(duration)})`);
return val;
};
}
function time(name, options) {
if (options.quiet) {
return (val) => val;
}
const startTime = new Date();
logTime(startTime, `Starting '${cyan(name)}' ...`);
return (val) => {
const endTime = new Date();
const duration = ms(endTime - startTime);
logTime(endTime, `Finished '${cyan(name)}' (${magenta(duration)})`);
return val;
};
}