Performance testing in PHP
I don't see any immediate problems with it, but I would probably simplified it a bit. Not sure why you're doing it in two loops like that, but I might be missing something of course :)

&lt;?php
$loops = 10000;

$start = microtime(true);

for ($i = 0; $i &lt; $loops; $i++)
    theFunction();

$total = microtime(true) - $start;
$avg = $total / $loops;

echo "Average: " . $avg . "s\n";