- microtime: documentation ( source)
<?php
interface TestInterface {
public function foo();
}
class Test implements TestInterface {
public function foo(...$extraArgs) {
$closureToCall = 'max'; //this function accepts multiple args
$start = microtime(true);
for ($i=0; $i<1e5; $i++) {
}
$end = microtime(true);
echo "Took: ", ($end-$start)*1e3, " ms";
$start = microtime(true);
for ($i=0; $i<1e5; $i++) {
}
$end = microtime(true);
echo "Took: ", ($end-$start)*1e3, " ms";
}
}
$obj = new Test;
$obj->foo();