Fix microtime breakage
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 29 May 2006 05:29:27 +0000 (05:29 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 29 May 2006 05:29:27 +0000 (05:29 +0000)
config/index.php
includes/GlobalFunctions.php

index bebff03..7f5ba34 100644 (file)
@@ -24,7 +24,7 @@ header( "Content-type: text/html; charset=utf-8" );
 @ini_set( "display_errors", true );
 
 # In case of errors, let output be clean.
-$wgRequestTime = microtime();
+$wgRequestTime = microtime( true );
 
 # Attempt to set up the include path, to fix problems with relative includes
 $IP = dirname( dirname( __FILE__ ) );
index 0a148e1..f8ef126 100644 (file)
@@ -249,11 +249,9 @@ function logProfilingData() {
        global $wgProfiling, $wgUser;
        $now = wfTime();
 
-       list( $usec, $sec ) = explode( ' ', $wgRequestTime );
-       $start = (float)$sec + (float)$usec;
-       $elapsed = $now - $start;
+       $elapsed = $now - $wgRequestTime;
        if ( $wgProfiling ) {
-               $prof = wfGetProfilingOutput( $start, $elapsed );
+               $prof = wfGetProfilingOutput( $wgRequestTime, $elapsed );
                $forward = '';
                if( !empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) )
                        $forward = ' forwarded for ' . $_SERVER['HTTP_X_FORWARDED_FOR'];
@@ -701,9 +699,7 @@ function wfHostname() {
                global $wgRequestTime;
 
                $now = wfTime();
-               list( $usec, $sec ) = explode( ' ', $wgRequestTime );
-               $start = (float)$sec + (float)$usec;
-               $elapsed = $now - $start;
+               $elapsed = $now - $wgRequestTime;
 
                $com = sprintf( "<!-- Served by %s in %01.3f secs. -->",
                  wfHostname(), $elapsed );