Call microtime() before and after the exec() command.
Better yet use this:
function getmicrotime()
{
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
return ($mtime);
}
$before = getmicrotime();
exec(thecommand);
$after = getmicrotime();
$timetaken = $after - $before; // subtract
echo substr($timetaken,0,4) // trims to X.XX seconds