obj =& get_instance(); $this->obj->load->language('profiler'); } // -------------------------------------------------------------------- /** * Auto Profiler * * This function cycles through the entire array of mark points and * matches any two points that are named identially (ending in "_start" * and "_end" respectively). It then compiles the execution times for * all points and returns it as an array * * @access private * @return array */ function _compile_benchmarks() { $profile = array(); foreach ($this->obj->benchmark->marker as $key => $val) { // We match the "end" marker so that the list ends // up in the order that it was defined if (preg_match("/(.+?)_end/i", $key, $match)) { if (isset($this->obj->benchmark->marker[$match[1].'_end'])) { $profile[$match[1]] = $this->obj->benchmark->elapsed_time($match[1].'_start', $key); } } } // Build a table containing the profile data. // Note: At some point we should turn this into a template that can // be modified. We also might want to make this data available to be logged $output = "\n\n"; $output .= '
\n\n"; return $output; } // -------------------------------------------------------------------- function _compile_queries() { $output = "\n\n"; $output .= '\n\n"; return $output; } // -------------------------------------------------------------------- function _compile_post() { $output = "\n\n"; $output .= '\n\n"; return $output; } // -------------------------------------------------------------------- /** * Run the Profiler * * @access private * @return string */ function run($output = '') { $obj =& get_instance(); $output = '