home ‣ Benchmarking php code fragments login
Here's how to do it:
function getmicrotime()
{
$t = microtime();
$t = explode(' ',$t);
return (float)$t[1]+ (float)$t[0];
}
function dobench1($ITER)
{
bench1();
$t1 = getmicrotime();
for ($i=$ITER; --$i >= 0;) {
bench1();
}
return getmicrotime() - $t1;
}