$a = array("профиль" => function() { return 0; });
...
if(isset($a[$b]))
$a[$b]();
else
echo "Команда не найдена";
$start_time = microtime(true);
for($i = 1; $i <= 1000; $i++){
//тут твой код
}
round(microtime(true) - $start_time,4)
$start_time = microtime(true);
for($i = 1; $i <= 1000; $i++){
//тут твой код
}
round(microtime(true) - $start_time,4)