lastMark = $this->getmicrotime(); } /** * Returns a reference to the global Profiler object, only creating it * if it doesn't already exist. * * This method must be invoked as: *
  $browser = & JProfiler::getInstance( $prefix );
* * @access public * @param string Prefix used to distinguish profiler objects. * @return easyProfiler The Profiler object. */ function &getInstance($prefix = '') { static $instances; if (!isset($instances)) { $instances = array(); } if (empty($instances[$prefix])) { $instances[$prefix] = new easyProfiler($prefix); } return $instances[$prefix]; } /** * Output a time mark * * @access public * @param string A label for the time mark * @return string Mark */ function mark( $label ) { $out = ''; $time = $this->getmicrotime(); $mark = $this->_prefix." $label: "; $mark .= sprintf('%.3f', $time - $this->_start) . ' seconds'; $out .= sprintf('%.3f', $time - $this->_start) . ' sec'; $out .= ' - '.sprintf('%.3f', $time - $this->lastMark) . ' sec'; $this->lastMark = $time; if ( function_exists('memory_get_usage') ) { $mark .= ', '.sprintf('%0.2f', memory_get_usage() / 1048576 ).' MB'; $out .= ' - '.sprintf('%0.2f', memory_get_usage() / 1048576 ).' MB'; } $this->_buffer[] = $mark; return ''.$out.' '; }//function }//class