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:
parent
1861b0f8f9
commit
40aafdb326
@ -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>'); ?> — <?php _e('<a href="http://wordpress.org/support/">Support Forums</a>'); ?> <br />
|
||||
<?php bloginfo('version'); ?> — <?php printf(__('%s seconds'), number_format(timer_stop(), 2)); ?>
|
||||
<?php bloginfo('version'); ?> — <?php printf(__('%s seconds'), timer_stop(0, 2)); ?>
|
||||
</p>
|
||||
</div>
|
||||
<?php do_action('admin_footer', ''); ?>
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user