[PHP] marker[$name] = Microtime (); }//--------------------------------------------------------------------/** * Calculates the time difference between The marked points. * Calculates the time between two points in time. * If The first parameter is empty this function instead returns the * {Elapsed_time} pseudo-variable false variable. This permits license for the full system * Execution time to being shown in a template. The output class would * swap the real value for this variable. * * @access public * @param string a particular marked point * @param string a particular marked point * @param integer th E Number of decimal places * @return Mixed */function elapsed_time ($point 1 = ", $point 2 =", $decimals = 4) {/* * if not Given a definite point in time, the duration of the entire program's run is calculated. * How can we calculate the running time of the whole program? In fact, this calculation is performed by the output component. * While calling Benchmark::elapsed_time (), (no arguments), essentially the first thing to return is not the time of the whole program to run, or the actual return is a {elapsed_time} tag, and then * output in the processing of outputs, Calculate the entire program run time, because the processing output stage program can be considered as the last stage, so can approximate the total time, and then the output of {elapsed_time} replaced. * the following memory_usage () principle is the same. */if ($point 1 = = ") {return ' {elapsed_tIME} '; } if (! isset ($this->marker[$point 1])) {return ';} if (! isset ($this->marker[$point 2]) {$this->marker[$poi Nt2] = Microtime (); }//Why list is used here because Microtime (); The return value is in the format "msec sec". List ($SM, $ss) = Explode (", $this->marker[$point 1]); List ($em, $es) = Explode (", $this->marker[$point 2]); Return Number_format (($em + $es)-($SM + $ss), $decimals); }//--------------------------------------------------------------------/** * Memory Usage * * This function returns the {memory_usage} pseudo-variable. * This permits it is put it anywhere in a template * without the memory being calculated until the end. * The output class would swap the real value for this variable. * www.2cto.com * @access public * @return String */function Memory_usage () {return ' {memory_usage} ';} End Ci_benchmark class/* End of File benchmark.php */* location:./system/core/benchmark.php */
http://www.bkjia.com/PHPjc/477730.html www.bkjia.com true http://www.bkjia.com/PHPjc/477730.html techarticle [PHP]-PHP if (! defined (BasePath)) exit (No Direct script access allowed);/** * CodeIgniter * * An open source appli Cation development framework for PHP 5.1.6 or newer * * @packag ...