Ejemplo n.º 1
0
 /**
  * Stop the benchmarking process by logging the micro seconds and memory usage and then outputting the results.
  *
  * @access public
  * @param string $slug
  * @param boolean $log
  * @return string|mixed
  * @static
  */
 public static function stop($slug = 'benchmark', $log = self::DONT_LOG)
 {
     if (Config::get('debug') > 0) {
         if (empty(static::$__benchmarks[$slug])) {
             return false;
         }
         static::$__benchmarks[$slug] = array('endTime' => microtime(true), 'endMemory' => memory_get_usage()) + static::$__benchmarks[$slug];
         if ($log === static::DO_LOG) {
             Logger::debug(static::display($slug));
         }
         return static::$__benchmarks[$slug];
     }
 }