timer_stop [ WordPress Function ]
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Return and/or display the time from the page start to when function is called.
You can get the results and print them by doing:
$nTimePageTookToExecute = timer_stop();
echo $nTimePageTookToExecute;
Or instead, you can do:
timer_stop(1);
which will do what the above does. If you need the result, you can assign it to a variable, but in most cases, you only need to echo it.
Source
<?php
function timer_stop( $display = 0, $precision = 3 ) { // if called like timer_stop(1), will echo $timetotal
global $timestart, $timeend;
$timeend = microtime( true );
$timetotal = $timeend - $timestart;
$r = ( function_exists( 'number_format_i18n' ) ) ? number_format_i18n( $timetotal, $precision ) : number_format( $timetotal, $precision );
if ( $display )
echo $r;
return $r;
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- Function Reference/timer stop « WordPress Codex
Description. This function returns the amount of time (in seconds) to generate the page. Usage. <?php timer_stop( $display = 0, $precision = 3 ) ?> Example ...
codex.wordpress.org - timer_stop | bootstrap.inc | Drupal 7 | Drupal API
7 bootstrap.inc, timer_stop($name). 8 bootstrap. ... function timer_stop($name) { global $timers; if (isset($timers[$name]['start'])) { $stop = microtime(TRUE); $diff ...
api.drupal.org - timer_stop | bootstrap.inc | Drupal 6 | Drupal API
Oct 14, 2010 ... 6 bootstrap.inc, timer_stop($name). 7 bootstrap.inc ... function timer_stop($name) { global $timers; $timers[$name]['time'] = timer_read($name); ...
api.drupal.org - Timer.Stop Method (System.Windows.Forms)
You can also stop the timer by setting the Enabled property to false. A Timer object may be enabled and disabled multiple times within the same application ...
msdn.microsoft.com
Kullanýcý Tartýþmalarý [ wordpress.org ]
- Tfleming on "Functions-compat.php disappears in middle of writing post???"
- colobren on "Functions-compat.php disappears in middle of writing post???"
- colobren on "Functions-compat.php disappears in middle of writing post???"
- Tfleming on "Functions-compat.php disappears in middle of writing post???"
- Tfleming on "Functions-compat.php disappears in middle of writing post???"
- YOTS on "Fatal error: Cannot redeclare timer_stop()"
- YOTS on "Fatal error: Cannot redeclare timer_stop()"
- Ajay on "High load time on upgrading to 2.1"