mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-05 18:32:23 +01:00
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:
parent
a7050af4f7
commit
23ddeba64d
@ -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> — <a href="http://wordpress.org/support/"><?php _e('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>
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user