Definition:
function timer_stop( $display = 0, $precision = 3 ) { // if called like timer_stop(1), will echo $timetotal
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:
Parameters
- int $display: Use ‘0’ or null to not echo anything and 1 to echo the total time
- int $precision: The amount of digits from the right of the decimal to display. Default is 3.
Return values
returns:The "second.microsecond" finished time calculation
Source code
function timer_stop( $display = 0, $precision = 3 ) { // if called like timer_stop(1), will echo $timetotal global $timestart, $timeend; $mtime = microtime(); $mtime = explode( ' ', $mtime ); $timeend = $mtime[1] + $mtime[0]; $timetotal = $timeend - $timestart; $r = ( function_exists( 'number_format_i18n' ) ) ? number_format_i18n( $timetotal, $precision ) : number_format( $timetotal, $precision ); if ( $display ) echo $r; return $r; }
3063
No comments yet... Be the first to leave a reply!