timer_stop() wanted to be near timer_start().
git-svn-id: http://svn.automattic.com/wordpress/trunk@4174 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b4ce019386
commit
0f7bb42a79
|
@ -293,22 +293,6 @@ function gzip_compression() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// functions to count the page generation time (from phpBB2)
|
|
||||||
// ( or just any time between timer_start() and timer_stop() )
|
|
||||||
|
|
||||||
function timer_stop($display = 0, $precision = 3) { //if called like timer_stop(1), will echo $timetotal
|
|
||||||
global $timestart, $timeend;
|
|
||||||
$mtime = microtime();
|
|
||||||
$mtime = explode(' ',$mtime);
|
|
||||||
$mtime = $mtime[1] + $mtime[0];
|
|
||||||
$timeend = $mtime;
|
|
||||||
$timetotal = $timeend-$timestart;
|
|
||||||
if ( $display )
|
|
||||||
echo number_format($timetotal,$precision);
|
|
||||||
return $timetotal;
|
|
||||||
}
|
|
||||||
|
|
||||||
function make_url_footnote($content) {
|
function make_url_footnote($content) {
|
||||||
preg_match_all('/<a(.+?)href=\"(.+?)\"(.*?)>(.+?)<\/a>/', $content, $matches);
|
preg_match_all('/<a(.+?)href=\"(.+?)\"(.*?)>(.+?)<\/a>/', $content, $matches);
|
||||||
$j = 0;
|
$j = 0;
|
||||||
|
|
|
@ -59,6 +59,18 @@ function timer_start() {
|
||||||
$timestart = $mtime;
|
$timestart = $mtime;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function timer_stop($display = 0, $precision = 3) { //if called like timer_stop(1), will echo $timetotal
|
||||||
|
global $timestart, $timeend;
|
||||||
|
$mtime = microtime();
|
||||||
|
$mtime = explode(' ',$mtime);
|
||||||
|
$mtime = $mtime[1] + $mtime[0];
|
||||||
|
$timeend = $mtime;
|
||||||
|
$timetotal = $timeend-$timestart;
|
||||||
|
if ( $display )
|
||||||
|
echo number_format($timetotal,$precision);
|
||||||
|
return $timetotal;
|
||||||
|
}
|
||||||
timer_start();
|
timer_start();
|
||||||
|
|
||||||
// Change to E_ALL for development/debugging
|
// Change to E_ALL for development/debugging
|
||||||
|
|
Loading…
Reference in New Issue