gyro/core/lib/helpers/timer.cls.php
Go to the documentation of this file.00001 <?php 00002 /** 00003 * A simple timer 00004 * 00005 * @author Gerd Riesselmann 00006 * @ingroup Lib 00007 */ 00008 class Timer { 00009 protected $start_time; 00010 00011 public function __construct() { 00012 $this->start_time = microtime(true); 00013 } 00014 00015 public function seconds_elapsed() { 00016 return microtime(true) - $this->start_time; 00017 } 00018 00019 public function milliseconds_elapsed() { 00020 return 1000 * $this->seconds_elapsed(); 00021 } 00022 }