diff options
author | Iban Eguia <admin@razican.com> | 2012-06-08 23:01:31 +0200 |
---|---|---|
committer | Iban Eguia <admin@razican.com> | 2012-06-08 23:01:31 +0200 |
commit | 895e98c0f04f1087e8900ce8423ad3210a423770 (patch) | |
tree | 6adfe487293df38807084599f1f04157b5531e54 /system/core/Benchmark.php | |
parent | 0ed4f63f4268b0c98f549ffd711702fd45a761d0 (diff) | |
parent | a593c69de4ea125c096f611c78dd0839489e7ebd (diff) |
Merge remote-tracking branch 'upstream/develop' into new_date
Diffstat (limited to 'system/core/Benchmark.php')
-rwxr-xr-x | system/core/Benchmark.php | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/system/core/Benchmark.php b/system/core/Benchmark.php index f6b634deb..2fabdf46e 100755 --- a/system/core/Benchmark.php +++ b/system/core/Benchmark.php @@ -25,13 +25,11 @@ * @filesource */ -// ------------------------------------------------------------------------ - /** * CodeIgniter Benchmark Class * * This class enables you to mark points and calculate the time difference - * between them. Memory consumption can also be displayed. + * between them. Memory consumption can also be displayed. * * @package CodeIgniter * @subpackage Libraries @@ -46,7 +44,7 @@ class CI_Benchmark { * * @var array */ - public $marker = array(); + public $marker = array(); // -------------------------------------------------------------------- @@ -61,7 +59,7 @@ class CI_Benchmark { */ public function mark($name) { - $this->marker[$name] = microtime(); + $this->marker[$name] = microtime(TRUE); } // -------------------------------------------------------------------- @@ -81,7 +79,7 @@ class CI_Benchmark { */ public function elapsed_time($point1 = '', $point2 = '', $decimals = 4) { - if ($point1 == '') + if ($point1 === '') { return '{elapsed_time}'; } @@ -93,13 +91,10 @@ class CI_Benchmark { if ( ! isset($this->marker[$point2])) { - $this->marker[$point2] = microtime(); + $this->marker[$point2] = microtime(TRUE); } - list($sm, $ss) = explode(' ', $this->marker[$point1]); - list($em, $es) = explode(' ', $this->marker[$point2]); - - return number_format(($em + $es) - ($sm + $ss), $decimals); + return number_format($this->marker[$point2] - $this->marker[$point1], $decimals); } // -------------------------------------------------------------------- @@ -122,4 +117,4 @@ class CI_Benchmark { } /* End of file Benchmark.php */ -/* Location: ./system/core/Benchmark.php */ +/* Location: ./system/core/Benchmark.php */
\ No newline at end of file |