日期:2013-09-23 浏览次数:20479 次
require_once('Benchmark/Iterate.php');
$benchmark = new Benchmark_Iterate();
$benchmark->run(10, 'myFunction','test');
$result = $benchmark->get();
echo "
"; print_r($result); echo "
";
exit;
function myFunction($var) {
// do something
echo 'Hello ';
}
?>
Array
(
[1] => 0.000427 [2] => 0.000079 [3] => 0.000072 [4] => 0.000071 [5] => 0.000076 [6] => 0.000070 [7] => 0.000073 [8] => 0.000070 [9] => 0.000074 [10] => 0.000072 [mean] => 0.000108 [iterations] => 10)