timer_created = $this->microtime_float(); } function microtime_float() { list($utime, $time) = explode(" ", microtime()); return ((float)$utime + (float)$time); } function start() { $this->start_time = $this->microtime_float(); } function stop() { $this->stop_time = $this->microtime_float(); } function total() { if ($this->start_time != null && $this->stop_time != null) { return $this->stop_time - $this->start_time; } return null; } function reset() { $start_time = null; $stop_time = null; } } $timer = new Timer(); for ($iterations = 10000; $iterations < 1000000; $iterations += 10000) { //print_r("Testing with {$iterations} iterations\n"); print_r($iterations); /*$timer->start(); for ($i = 0; $i < $iterations; $i++) { if (file_exists('testo')) { unlink('testo'); } } $timer->stop(); //print_r("Total time with file_exists():\t\t {$timer->total()} seconds\n"); //print_r(",{$timer->total()}\n"); $timer->reset();*/ $timer->start(); for ($i = 0; $i < $iterations; $i++) { @unlink('testo'); } $timer->stop(); //print_r("Total time with error_supression():\t {$timer->total()} seconds\n"); print_r(",{$timer->total()}\n"); $timer->reset(); }