Retrieves or displays the time from the page start to when function is called.
Parameters
$displayint|boolrequired- Whether to echo or return the results. Accepts
0|falsefor return,1|truefor echo. Default0|false. $precisionintoptional- The number of digits from the right of the decimal to display.
Default:
3
Source
function timer_stop( $display = 0, $precision = 3 ) {
global $timestart, $timeend;
$timeend = microtime( true );
$timetotal = $timeend - $timestart;
if ( function_exists( 'number_format_i18n' ) ) {
$r = number_format_i18n( $timetotal, $precision );
} else {
$r = number_format( $timetotal, $precision );
}
if ( $display ) {
echo $r;
}
return $r;
}
Changelog
| Version | Description |
|---|---|
| 0.71 | Introduced. |
Determine length of time to render page with a precision of 3, 5 and 10 digits.
Output:
Check the Pages load Time in seconds