INNER CODE UNIT · JavaScript
elapsed
pmadruga/react-native-clean-project · source/internals/executor.js:5
const elapsed = process.hrtime(startTime)[1] / 1000000;
const secondCount = process.hrtime(startTime)[0];
const millisecondCount = elapsed.toFixed(precision);
if (secondCount > 0) return `${secondCount}s`;
return `${millisecondCount}ms`;
}
async function executeTask(task) {
// return new Promise((resolve, reject) => {
const startTime = process.hrtime();
const spawnedTask = await spawn(task.command, task.args, { shell: true });
// These are just warnings and will be disabled for now.
// spawnedTask.stderr.on('data', data => {
// console.log(`Error running '${task.name}': ${data}`);
// });