Ticket #39163: large.diff
File large.diff, 3.7 KB (added by , 7 years ago) |
---|
-
wp-admin/upgrade.php
19 19 20 20 nocache_headers(); 21 21 22 timer_start();23 22 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 24 23 25 24 delete_site_transient('update_core'); -
wp-includes/load.php
5 5 * @package WordPress 6 6 */ 7 7 8 // Compat for PHP < 5.4.0 9 if ( !isset( $_SERVER['REQUEST_TIME_FLOAT'] ) ) 10 $_SERVER['REQUEST_TIME_FLOAT'] = microtime( true ); 11 12 // Start the request timer 13 $GLOBALS['timestart'] = $_SERVER['REQUEST_TIME_FLOAT']; 14 8 15 /** 9 16 * Return the HTTP protocol sent by the server. 10 17 * … … 228 235 } 229 236 230 237 /** 231 * Start the WordPress micro-timer.232 *233 238 * @since 0.71 234 239 * @access private 235 * 236 * @global float $timestart Unix timestamp set at the beginning of the page load. 240 * @deprecated 237 241 * @see timer_stop() 238 *239 242 * @return bool Always returns true. 240 243 */ 241 244 function timer_start() { 242 global $timestart;243 $timestart = microtime( true );244 245 return true; 245 246 } 246 247 247 248 /** 249 * Get the time elapsed so far during this PHP script. 250 * 251 * REQUEST_TIME_FLOAT appeared in PHP 5.4.0. 252 * 253 * @since 254 * 255 * @return float Seconds since the PHP script started. 256 */ 257 function timer_float() { 258 return microtime( true ) - $_SERVER['REQUEST_TIME_FLOAT']; 259 } 260 261 /** 248 262 * Retrieve or display the time from the page start to when function is called. 249 263 * 264 * WARNING: Due to localization, the resulting string can not reliably be used 265 * as a number. Some locales swap the commas and periods. 266 * Example: number_format_i18n( 1000 ) => '1.000,0' 267 * For accurate timing data, use timer_float(). 268 * 250 269 * @since 0.71 251 270 * 252 * @global float $timestart Seconds from when timer_start() is called.253 * @global float $timeend Seconds from when function is called.271 * @global float $timestart Timestamp from start of PHP script. 272 * @global float $timeend Timestamp from last call to timer_stop(). 254 273 * 255 * @param int|bool $display Whether to echo or return the results. Accepts 0|false for return, 256 * 1|true for echo. Default 0|false. 257 * @param int $precision The number of digits from the right of the decimal to display. 258 * Default 3. 259 * @return string The "second.microsecond" finished time calculation. The number is formatted 274 * @param bool $display Whether to echo the results. Default false. 275 * @param int $precision The number of decimal digits. Default 3 (millisecond precision). 276 * @return string The "second.millisecond" finished time calculation. The number is formatted 260 277 * for human consumption, both localized and rounded. 261 278 */ 262 function timer_stop( $display = 0, $precision = 3 ) {279 function timer_stop( $display = false, $precision = 3 ) { 263 280 global $timestart, $timeend; 264 $timeend = microtime( true ); 265 $timetotal = $timeend - $timestart; 266 $r = ( function_exists( 'number_format_i18n' ) ) ? number_format_i18n( $timetotal, $precision ) : number_format( $timetotal, $precision ); 281 $elapsed = timer_float(); 282 $timeend = $timestart + $elapsed; 283 if ( function_exists( 'number_format_i18n' ) ) 284 $r = number_format_i18n( $elapsed, $precision ); 285 else 286 $r = number_format( $elapsed, $precision ); 267 287 if ( $display ) 268 288 echo $r; 269 289 return $r; -
wp-settings.php
62 62 // Check if we're in maintenance mode. 63 63 wp_maintenance(); 64 64 65 // Start loading timer.66 timer_start();67 68 65 // Check if we're in WP_DEBUG mode. 69 66 wp_debug_mode(); 70 67