- microtime: documentation ( source)
<?php
$a = 1;
$b = 2;
$c = 3;
$d = 4;
$e = 5;
$start = microtime(true);
for ( $i=0; $i<1000000; $i++ ){
if ( $a == 1 && $b == 2 && $c == 3 && $d == 4 && $e == 5 ) {}
}
echo $time_elapsed_secs = microtime(true) - $start . " | ";
$start = microtime(true);
for ( $i=0; $i<1000000; $i++ ){
if ( $a == 1 ){
if ( $b == 2 ) {
if ( $c == 3 ) {
if ( $d == 4 ) {
if ( $e == 5 ) {}
}
}
}
}
}
echo $time_elapsed_secs = microtime(true) - $start;