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