r110642 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110641‎ | r110642 | r110643 >
Date:08:32, 3 February 2012
Author:ialex
Status:ok
Tags:
Comment:
wfTime() -> microtime( true ), no need to use the former which is just a wrapper to the latter
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)
  • /trunk/phase3/includes/Wiki.php (modified) (history)
  • /trunk/phase3/includes/WikiPage.php (modified) (history)
  • /trunk/phase3/includes/debug/Debug.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/debug/Debug.php
@@ -200,7 +200,7 @@
201201 'function' => $function,
202202 'master' => (bool) $isMaster,
203203 'time' > 0.0,
204 - '_start' => wfTime(),
 204+ '_start' => microtime( true ),
205205 );
206206
207207 return count( self::$query ) - 1;
@@ -216,7 +216,7 @@
217217 return;
218218 }
219219
220 - self::$query[$id]['time'] = wfTime() - self::$query[$id]['_start'];
 220+ self::$query[$id]['time'] = microtime( true ) - self::$query[$id]['_start'];
221221 unset( self::$query[$id]['_start'] );
222222 }
223223
@@ -257,7 +257,7 @@
258258 $debugInfo = array(
259259 'mwVersion' => $wgVersion,
260260 'phpVersion' => PHP_VERSION,
261 - 'time' => wfTime() - $wgRequestTime,
 261+ 'time' => microtime( true ) - $wgRequestTime,
262262 'log' => self::$log,
263263 'debugLog' => self::$debug,
264264 'queries' => self::$query,
Index: trunk/phase3/includes/GlobalFunctions.php
@@ -1056,8 +1056,7 @@
10571057
10581058 // Get total page request time and only show pages that longer than
10591059 // $wgProfileLimit time (default is 0)
1060 - $now = wfTime();
1061 - $elapsed = $now - $wgRequestTime;
 1060+ $elapsed = microtime( true ) - $wgRequestTime;
10621061 if ( $elapsed <= $wgProfileLimit ) {
10631062 return;
10641063 }
@@ -1560,8 +1559,7 @@
15611560 function wfReportTime() {
15621561 global $wgRequestTime, $wgShowHostnames;
15631562
1564 - $now = wfTime();
1565 - $elapsed = $now - $wgRequestTime;
 1563+ $elapsed = microtime( true ) - $wgRequestTime;
15661564
15671565 return $wgShowHostnames
15681566 ? sprintf( '<!-- Served by %s in %01.3f secs. -->', wfHostname(), $elapsed )
Index: trunk/phase3/includes/Wiki.php
@@ -431,9 +431,9 @@
432432
433433 while ( $n-- && false != ( $job = Job::pop() ) ) {
434434 $output = $job->toString() . "\n";
435 - $t = -wfTime();
 435+ $t = - microtime( true );
436436 $success = $job->run();
437 - $t += wfTime();
 437+ $t += microtime( true );
438438 $t = round( $t * 1000 );
439439 if ( !$success ) {
440440 $output .= "Error: " . $job->getLastError() . ", Time: $t ms\n";
Index: trunk/phase3/includes/WikiPage.php
@@ -2861,10 +2861,10 @@
28622862 $text = $rev->getText();
28632863 }
28642864
2865 - $time = - wfTime();
 2865+ $time = - microtime( true );
28662866 $this->parserOutput = $wgParser->parse( $text, $this->page->getTitle(),
28672867 $this->parserOptions, true, true, $this->revid );
2868 - $time += wfTime();
 2868+ $time += microtime( true );
28692869
28702870 # Timing hack
28712871 if ( $time > 3 ) {

Status & tagging log