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

git-svn-id: https://develop.svn.wordpress.org/trunk@4345 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2006-10-04 22:00:53 +00:00
parent 1861b0f8f9
commit 40aafdb326
2 changed files with 4 additions and 3 deletions

View File

@ -3,7 +3,7 @@
<p><a href="http://wordpress.org/" id="wordpress-logo"><img src="images/wordpress-logo.png" alt="WordPress" /></a></p>
<p>
<?php _e('<a href="http://codex.wordpress.org/">Documentation</a>'); ?> &#8212; <?php _e('<a href="http://wordpress.org/support/">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>
<?php do_action('admin_footer', ''); ?>

View File

@ -67,9 +67,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;
}
timer_start();