allow timer_stop() to use number_format() when returning. Props mdawaffe and nbachiyski. fixes #991

git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4344 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2006-10-04 22:00:26 +00:00
parent a7050af4f7
commit 23ddeba64d
2 changed files with 5 additions and 4 deletions

View File

@ -2,7 +2,7 @@
<div id="footer"><p><a href="http://wordpress.org/" id="wordpress-logo"><img src="images/wordpress-logo.png" alt="WordPress" /></a></p>
<p>
<a href="http://codex.wordpress.org/"><?php _e('Documentation'); ?></a> &#8212; <a href="http://wordpress.org/support/"><?php _e('Support Forums'); ?></a> <br />
<?php bloginfo('version'); ?> &#8212; <?php printf(__('%s seconds'), number_format(timer_stop(), 2)); ?>
<?php bloginfo('version'); ?> &#8212; <?php printf(__('%s seconds'), timer_stop(0, 2)); ?>
</p>
</div>

View File

@ -844,9 +844,10 @@ function timer_stop($display = 0, $precision = 3) { //if called like timer_stop(
$mtime = $mtime[1] + $mtime[0];
$timeend = $mtime;
$timetotal = $timeend-$timestart;
$r = number_format($timetotal, $precision);
if ( $display )
echo number_format($timetotal,$precision);
return $timetotal;
echo $r;
return $r;
}
function weblog_ping($server = '', $path = '') {
@ -2508,4 +2509,4 @@ function wp_die($message, $title = '') {
die();
}
?>
?>