converted to unix-style eol
[www-register-wizard.git] / libraries / Benchmark.php
index 4984bb1..fec5071 100644 (file)
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');\r
-/**\r
- * CodeIgniter\r
- *\r
- * An open source application development framework for PHP 4.3.2 or newer\r
- *\r
- * @package            CodeIgniter\r
- * @author             ExpressionEngine Dev Team\r
- * @copyright  Copyright (c) 2008, EllisLab, Inc.\r
- * @license            http://codeigniter.com/user_guide/license.html\r
- * @link               http://codeigniter.com\r
- * @since              Version 1.0\r
- * @filesource\r
- */\r
-\r
-// ------------------------------------------------------------------------\r
-\r
-/**\r
- * CodeIgniter Benchmark Class\r
- *\r
- * This class enables you to mark points and calculate the time difference\r
- * between them.  Memory consumption can also be displayed.\r
- *\r
- * @package            CodeIgniter\r
- * @subpackage Libraries\r
- * @category   Libraries\r
- * @author             ExpressionEngine Dev Team\r
- * @link               http://codeigniter.com/user_guide/libraries/benchmark.html\r
- */\r
-class CI_Benchmark {\r
-\r
-       var $marker = array();\r
-\r
-       // --------------------------------------------------------------------\r
-\r
-       /**\r
-        * Set a benchmark marker\r
-        *\r
-        * Multiple calls to this function can be made so that several\r
-        * execution points can be timed\r
-        *\r
-        * @access      public\r
-        * @param       string  $name   name of the marker\r
-        * @return      void\r
-        */\r
-       function mark($name)\r
-       {\r
-               $this->marker[$name] = microtime();\r
-       }\r
-\r
-       // --------------------------------------------------------------------\r
-\r
-       /**\r
-        * Calculates the time difference between two marked points.\r
-        *\r
-        * If the first parameter is empty this function instead returns the\r
-        * {elapsed_time} pseudo-variable. This permits the full system\r
-        * execution time to be shown in a template. The output class will\r
-        * swap the real value for this variable.\r
-        *\r
-        * @access      public\r
-        * @param       string  a particular marked point\r
-        * @param       string  a particular marked point\r
-        * @param       integer the number of decimal places\r
-        * @return      mixed\r
-        */\r
-       function elapsed_time($point1 = '', $point2 = '', $decimals = 4)\r
-       {\r
-               if ($point1 == '')\r
-               {\r
-                       return '{elapsed_time}';\r
-               }\r
-\r
-               if ( ! isset($this->marker[$point1]))\r
-               {\r
-                       return '';\r
-               }\r
-\r
-               if ( ! isset($this->marker[$point2]))\r
-               {\r
-                       $this->marker[$point2] = microtime();\r
-               }\r
-       \r
-               list($sm, $ss) = explode(' ', $this->marker[$point1]);\r
-               list($em, $es) = explode(' ', $this->marker[$point2]);\r
-\r
-               return number_format(($em + $es) - ($sm + $ss), $decimals);\r
-       }\r
-       \r
-       // --------------------------------------------------------------------\r
-\r
-       /**\r
-        * Memory Usage\r
-        *\r
-        * This function returns the {memory_usage} pseudo-variable.\r
-        * This permits it to be put it anywhere in a template\r
-        * without the memory being calculated until the end.\r
-        * The output class will swap the real value for this variable.\r
-        *\r
-        * @access      public\r
-        * @return      string\r
-        */\r
-       function memory_usage()\r
-       {\r
-               return '{memory_usage}';\r
-       }\r
-\r
-}\r
-\r
-// END CI_Benchmark class\r
-\r
-/* End of file Benchmark.php */\r
+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 4.3.2 or newer
+ *
+ * @package            CodeIgniter
+ * @author             ExpressionEngine Dev Team
+ * @copyright  Copyright (c) 2008, EllisLab, Inc.
+ * @license            http://codeigniter.com/user_guide/license.html
+ * @link               http://codeigniter.com
+ * @since              Version 1.0
+ * @filesource
+ */
+
+// ------------------------------------------------------------------------
+
+/**
+ * CodeIgniter Benchmark Class
+ *
+ * This class enables you to mark points and calculate the time difference
+ * between them.  Memory consumption can also be displayed.
+ *
+ * @package            CodeIgniter
+ * @subpackage Libraries
+ * @category   Libraries
+ * @author             ExpressionEngine Dev Team
+ * @link               http://codeigniter.com/user_guide/libraries/benchmark.html
+ */
+class CI_Benchmark {
+
+       var $marker = array();
+
+       // --------------------------------------------------------------------
+
+       /**
+        * Set a benchmark marker
+        *
+        * Multiple calls to this function can be made so that several
+        * execution points can be timed
+        *
+        * @access      public
+        * @param       string  $name   name of the marker
+        * @return      void
+        */
+       function mark($name)
+       {
+               $this->marker[$name] = microtime();
+       }
+
+       // --------------------------------------------------------------------
+
+       /**
+        * Calculates the time difference between two marked points.
+        *
+        * If the first parameter is empty this function instead returns the
+        * {elapsed_time} pseudo-variable. This permits the full system
+        * execution time to be shown in a template. The output class will
+        * swap the real value for this variable.
+        *
+        * @access      public
+        * @param       string  a particular marked point
+        * @param       string  a particular marked point
+        * @param       integer the number of decimal places
+        * @return      mixed
+        */
+       function elapsed_time($point1 = '', $point2 = '', $decimals = 4)
+       {
+               if ($point1 == '')
+               {
+                       return '{elapsed_time}';
+               }
+
+               if ( ! isset($this->marker[$point1]))
+               {
+                       return '';
+               }
+
+               if ( ! isset($this->marker[$point2]))
+               {
+                       $this->marker[$point2] = microtime();
+               }
+       
+               list($sm, $ss) = explode(' ', $this->marker[$point1]);
+               list($em, $es) = explode(' ', $this->marker[$point2]);
+
+               return number_format(($em + $es) - ($sm + $ss), $decimals);
+       }
+       
+       // --------------------------------------------------------------------
+
+       /**
+        * Memory Usage
+        *
+        * This function returns the {memory_usage} pseudo-variable.
+        * This permits it to be put it anywhere in a template
+        * without the memory being calculated until the end.
+        * The output class will swap the real value for this variable.
+        *
+        * @access      public
+        * @return      string
+        */
+       function memory_usage()
+       {
+               return '{memory_usage}';
+       }
+
+}
+
+// END CI_Benchmark class
+
+/* End of file Benchmark.php */
 /* Location: ./system/libraries/Benchmark.php */
\ No newline at end of file