Skip to content
Snippets Groups Projects
Commit 6071f873 authored by Axel Hahn's avatar Axel Hahn
Browse files

add timer on exec

parent 4b06517a
No related branches found
No related tags found
No related merge requests found
......@@ -67,18 +67,20 @@ function _exec($cmd): void
{
global $aCol;
echo "$aCol[blue]cmd > $cmd$aCol[reset]\n";
$iStart=microtime(true);
exec("$cmd 2>&1", $aOut, $rc);
$iEnd=microtime(true);
if (!count($aOut)) {
$aOut = ["-- no output --"];
}
echo implode("\n", $aOut) . "\n";
$sTime= "... ⏱️ Time: " . round($iEnd-$iStart, 3) . "s\n";
if ($rc != 0) {
echo "rc=$rc ";
echo "rc=$rc $sTime";
_abort("Error: Command failed. Aborting.", $rc);
}
_ok();
_ok($sTime);
}
function _mkdir(string $sMyDir): void
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment