WordPress.org

Make WordPress Core

Ticket #16753: 16753.2.patch

File 16753.2.patch, 2.1 KB (added by hakre, 3 years ago)

w/o additional fixes

  • wp-content/plugins/akismet/akismet.php

     
    202202} 
    203203 
    204204function akismet_microtime() { 
    205         $mtime = explode( ' ', microtime() ); 
    206         return $mtime[1] + $mtime[0]; 
     205        return microtime( true ); 
    207206} 
    208207 
    209208// log an event for a given comment, storing it in comment_meta 
  • wp-includes/load.php

     
    186186 */ 
    187187function timer_start() { 
    188188        global $timestart; 
    189         $mtime = explode( ' ', microtime() ); 
    190         $timestart = $mtime[1] + $mtime[0]; 
     189        $timestart = microtime( true ); 
    191190        return true; 
    192191} 
    193192 
     
    217216 */ 
    218217function timer_stop( $display = 0, $precision = 3 ) { // if called like timer_stop(1), will echo $timetotal 
    219218        global $timestart, $timeend; 
    220         $mtime = microtime(); 
    221         $mtime = explode( ' ', $mtime ); 
    222         $timeend = $mtime[1] + $mtime[0]; 
     219        $timeend = microtime( true ); 
    223220        $timetotal = $timeend - $timestart; 
    224221        $r = ( function_exists( 'number_format_i18n' ) ) ? number_format_i18n( $timetotal, $precision ) : number_format( $timetotal, $precision ); 
    225222        if ( $display ) 
  • wp-includes/wp-db.php

     
    14441444         * @return true 
    14451445         */ 
    14461446        function timer_start() { 
    1447                 $mtime            = explode( ' ', microtime() ); 
    1448                 $this->time_start = $mtime[1] + $mtime[0]; 
     1447                $this->time_start = microtime( true ); 
    14491448                return true; 
    14501449        } 
    14511450 
     
    14571456         * @return int Total time spent on the query, in milliseconds 
    14581457         */ 
    14591458        function timer_stop() { 
    1460                 $mtime      = explode( ' ', microtime() ); 
    1461                 $time_end   = $mtime[1] + $mtime[0]; 
    1462                 $time_total = $time_end - $this->time_start; 
    1463                 return $time_total; 
     1459                $time_total = microtime( true ) - $this->time_start; 
     1460                return (int) $time_total; 
    14641461        } 
    14651462 
    14661463        /**