- microtime: documentation ( source)
- test1: documentation ( source)
- test2: documentation ( source)
<?php
function test1() {
$s = microtime(true);
for ($i = 0; $i < 1000000; $i++) {
}
return microtime(true) - $s;
}
function test2() {
$s = microtime(true);
$i = 0;
while ($i < 1000000) {
$i++;
}
return microtime(true) - $s;
}
echo test1() . "\n\n";
echo test2() . "\n\n";