https://www.mediawiki.org/wiki/Special:Code/MediaWiki/110558

Revision: 110558
Author:   ialex
Date:     2012-02-02 10:33:42 +0000 (Thu, 02 Feb 2012)
Log Message:
-----------
Use $wgRequestTime in wfDebugTimer() to get the time since the start of the 
request instead the difference with the first call so that the time before that 
call is not ignored and for consistency with other time displays.

Modified Paths:
--------------
    trunk/phase3/includes/GlobalFunctions.php

Modified: trunk/phase3/includes/GlobalFunctions.php
===================================================================
--- trunk/phase3/includes/GlobalFunctions.php   2012-02-02 10:30:57 UTC (rev 
110557)
+++ trunk/phase3/includes/GlobalFunctions.php   2012-02-02 10:33:42 UTC (rev 
110558)
@@ -911,20 +911,15 @@
  * @return string
  */
 function wfDebugTimer() {
-       global $wgDebugTimestamps;
+       global $wgDebugTimestamps, $wgRequestTime;
+
        if ( !$wgDebugTimestamps ) {
                return '';
        }
-       static $start = null;
 
-       if ( $start === null ) {
-               $start = microtime( true );
-               $prefix = "\n$start";
-       } else {
-               $prefix = sprintf( "%6.4f", microtime( true ) - $start );
-       }
-       $mem = sprintf( "%5.1fM", ( memory_get_usage( true ) / (1024*1024) ) );
-       return "$prefix $mem  " ;
+       $prefix = sprintf( "%6.4f", microtime( true ) - $wgRequestTime );
+       $mem = sprintf( "%5.1fM", ( memory_get_usage( true ) / ( 1024 * 1024 ) 
) );
+       return "$prefix $mem  ";
 }
 
 /**


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to