Timing with microtime() : microtime « Date « PHP






Timing with microtime()

 
<?php
$start = microtime(true);
for ($i = 0; $i < 1000; $i++) {
    preg_match('/age=\d+/',$_SERVER['QUERY_STRING']);
}
$end = microtime(true);
$elapsed = $end - $start;
  
  








Related examples in the same category

1.mixed microtime ( [bool float_output] ) returns a highly accurate reading of the current time