- microtime: documentation ( source)
- number_format: documentation ( source)
<?php
class Test {
public function method()
{
}
}
$obj = new Test;
$ref = new ReflectionMethod($obj, 'method');
echo "Starting loop...";
$start = microtime(true);
for ($i=0; $i<1e6; $i++) {
$obj->method(array());
}
echo "Took ", number_format((microtime(true)-$start)*1e3, 3), " ms";