Hier der Code:
Code: Alles auswählen
<?php
for ($j=0; $j<10; $j++) {
$times_fe=$times_if=0;
for ($i=0; $i<50000; $i++) {
$starta=microtime(true);
file_exists('robots.txt');
$times_fe+=(microtime(true)-$starta);
$startb=microtime(true);
is_file('robots.txt');
$times_if+=(microtime(true)-$startb);
clearstatcache();
}
echo 'file_exists: '.($times_fe).'<br>';
echo 'is_file: '.($times_if).'<br>';
}
?>

Ergebnisse:
file_exists: 1.9488929999999
is_file: -2.4410359999992
file_exists: -2.5928619999991
is_file: 2.5952070000004
file_exists: 0.60511600000008
is_file: 0.19567800000002
file_exists: -0.42561999999985
is_file: -0.31281099999997
file_exists: 1.1311709999997
is_file: -1.2134630000004
file_exists: 0.80221000000004
is_file: -0.55545899999994
file_exists: 0.23826499999993
is_file: -0.57814499999986
file_exists: -0.52606399999991
is_file: -0.55386000000004
file_exists: 1.7290890000001
is_file: -0.60495099999995
file_exists: -1.830836
is_file: 1.0281040000001