Changeset 27335
- Timestamp:
- 03/01/2014 02:41:45 AM (12 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/load.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/load.php
r27332 r27335 197 197 198 198 /** 199 * Return and/or display the time from the page start to when function is called. 200 * 201 * You can get the results and print them by doing: 202 * <code> 203 * $nTimePageTookToExecute = timer_stop(); 204 * echo $nTimePageTookToExecute; 205 * </code> 206 * 207 * Or instead, you can do: 208 * <code> 209 * timer_stop(1); 210 * </code> 211 * which will do what the above does. If you need the result, you can assign it to a variable, but 212 * in most cases, you only need to echo it. 199 * Retrieve or display the time from the page start to when function is called. 213 200 * 214 201 * @since 0.71 215 * @global float $timestart Seconds from when timer_start() is called 216 * @global float $timeend Seconds from when function is called 217 * 218 * @param int $display Use '0' or null to not echo anything and 1 to echo the total time 219 * @param int $precision The amount of digits from the right of the decimal to display. Default is 3. 220 * @return string The "second.microsecond" finished time calculation. The number is formatted for human consumption, it is both localized and rounded. 221 */ 222 function timer_stop( $display = 0, $precision = 3 ) { // if called like timer_stop(1), will echo $timetotal 202 * 203 * @global float $timestart Seconds from when timer_start() is called. 204 * @global float $timeend Seconds from when function is called. 205 * 206 * @param int $display Whether to echo or return the results. Accepts 0|false for return, 207 * 1|true for echo. Default 0|false. 208 * @param int $precision The number of digits from the right of the decimal to display. 209 * Default 3. 210 * @return string The "second.microsecond" finished time calculation. The number is formatted 211 * for human consumption, both localized and rounded. 212 */ 213 function timer_stop( $display = 0, $precision = 3 ) { 223 214 global $timestart, $timeend; 224 215 $timeend = microtime( true );
Note: See TracChangeset
for help on using the changeset viewer.