WordPress.org

Make WordPress Core

Ticket #39163: small.diff

File small.diff, 787 bytes (added by andy, 3 years ago)
  • wp-includes/load.php

     
    55 * @package WordPress
    66 */
    77
     8// Compat for PHP < 5.4.0
     9if ( !isset( $_SERVER['REQUEST_TIME_FLOAT'] ) )
     10        $_SERVER['REQUEST_TIME_FLOAT'] = microtime( true );
     11
    812/**
    913 * Return the HTTP protocol sent by the server.
    1014 *
     
    228232}
    229233
    230234/**
     235 * Get the time elapsed so far during this PHP script.
     236 *
     237 * REQUEST_TIME_FLOAT appeared in PHP 5.4.0.
     238 *
     239 * @since
     240 *
     241 * @return float Seconds since the PHP script started.
     242 */
     243function timer_float() {
     244        return microtime( true ) - $_SERVER['REQUEST_TIME_FLOAT'];
     245}
     246
     247/**
    231248 * Start the WordPress micro-timer.
    232249 *
    233250 * @since 0.71