№3
Замерить время выполнения участка кода
<?php
function bench($fn){
$start = microtime(true);
$fn();
return microtime(true) - $start;
}
echo bench(function(){ sleep(1); });
1.0001661777496
Замерить время выполнения участка кода
<?php
function bench($fn){
$start = microtime(true);
$fn();
return microtime(true) - $start;
}
echo bench(function(){ sleep(1); });
1.0001661777496