r107861 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107860‎ | r107861 | r107862 >
Date:04:02, 3 January 2012
Author:johnduhart
Status:ok (Comments)
Tags:
Comment:
Using wfTime in place of microtime
Modified paths:
  • /trunk/phase3/includes/debug/Debug.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/debug/Debug.php
@@ -108,7 +108,7 @@
109109 'function' => $function,
110110 'master' => (bool) $isMaster,
111111 'time' > 0.0,
112 - '_start' => microtime( true ),
 112+ '_start' => wfTime(),
113113 );
114114
115115 return count( self::$query ) - 1;
@@ -124,7 +124,7 @@
125125 return;
126126 }
127127
128 - self::$query[$id]['time'] = microtime( true ) - self::$query[$id]['_start'];
 128+ self::$query[$id]['time'] = wfTime() - self::$query[$id]['_start'];
129129 unset( self::$query[$id]['_start'] );
130130 }
131131
@@ -181,7 +181,7 @@
182182 $debugInfo = array(
183183 'mwVersion' => $wgVersion,
184184 'phpVersion' => PHP_VERSION,
185 - 'time' => microtime( true ) - $wgRequestTime,
 185+ 'time' => wfTime() - $wgRequestTime,
186186 'log' => self::$log,
187187 'debugLog' => self::$debug,
188188 'queries' => self::$query,

Comments

#Comment by IAlex (talk | contribs)   11:11, 3 January 2012

We should rather deprecate wfTime() and replace other calls to that function.

#Comment by Johnduhart (talk | contribs)   11:11, 3 January 2012

And just call microtime directly?

#Comment by IAlex (talk | contribs)   11:12, 3 January 2012

Yes.

Status & tagging log