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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user