timer_stop() wanted to be near timer_start().
git-svn-id: https://develop.svn.wordpress.org/trunk@4174 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
d51b58448f
commit
58370c3575
@ -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) {
|
||||
preg_match_all('/<a(.+?)href=\"(.+?)\"(.*?)>(.+?)<\/a>/', $content, $matches);
|
||||
$j = 0;
|
||||
|
@ -59,6 +59,18 @@ function timer_start() {
|
||||
$timestart = $mtime;
|
||||
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();
|
||||
|
||||
// Change to E_ALL for development/debugging
|
||||
|
Loading…
Reference in New Issue
Block a user