mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-14 22:56:19 +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/trunk@4345 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1c9f6b4852
commit
a9d23d40d5
@ -3,7 +3,7 @@
|
|||||||
<p><a href="http://wordpress.org/" id="wordpress-logo"><img src="images/wordpress-logo.png" alt="WordPress" /></a></p>
|
<p><a href="http://wordpress.org/" id="wordpress-logo"><img src="images/wordpress-logo.png" alt="WordPress" /></a></p>
|
||||||
<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 _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>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<?php do_action('admin_footer', ''); ?>
|
<?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];
|
$mtime = $mtime[1] + $mtime[0];
|
||||||
$timeend = $mtime;
|
$timeend = $mtime;
|
||||||
$timetotal = $timeend-$timestart;
|
$timetotal = $timeend-$timestart;
|
||||||
|
$r = number_format($timetotal, $precision);
|
||||||
if ( $display )
|
if ( $display )
|
||||||
echo number_format($timetotal,$precision);
|
echo $r;
|
||||||
return $timetotal;
|
return $r;
|
||||||
}
|
}
|
||||||
timer_start();
|
timer_start();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user