Index: trunk/phase3/maintenance/commandLine.inc |
— | — | @@ -5,7 +5,7 @@ |
6 | 6 | * @subpackage Maintenance |
7 | 7 | */ |
8 | 8 | |
9 | | -$wgRequestTime = microtime(); |
| 9 | +$wgRequestTime = microtime(true); |
10 | 10 | |
11 | 11 | /** */ |
12 | 12 | # Abort if called from a web server |
Index: trunk/phase3/index.php |
— | — | @@ -3,7 +3,7 @@ |
4 | 4 | * Main wiki script; see docs/design.txt |
5 | 5 | * @package MediaWiki |
6 | 6 | */ |
7 | | -$wgRequestTime = microtime(); |
| 7 | +$wgRequestTime = microtime(true); |
8 | 8 | |
9 | 9 | # getrusage() does not exist on the Microsoft Windows platforms, catching this |
10 | 10 | if ( function_exists ( 'getrusage' ) ) { |
Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -916,8 +916,7 @@ |
917 | 917 | * @return float |
918 | 918 | */ |
919 | 919 | function wfTime() { |
920 | | - $st = explode( ' ', microtime() ); |
921 | | - return (float)$st[0] + (float)$st[1]; |
| 920 | + return microtime(true); |
922 | 921 | } |
923 | 922 | |
924 | 923 | /** |
Index: trunk/phase3/includes/Profiling.php |
— | — | @@ -51,7 +51,7 @@ |
52 | 52 | global $wgRequestTime; |
53 | 53 | if ( !empty( $wgRequestTime ) ) { |
54 | 54 | $this->mWorkStack[] = array( '-total', 0, $wgRequestTime, 0 ); |
55 | | - $this->mStack[] = array( '-setup', 1, $wgRequestTime, 0, microtime(), 0 ); |
| 55 | + $this->mStack[] = array( '-setup', 1, $wgRequestTime, 0, microtime(true), 0 ); |
56 | 56 | } else { |
57 | 57 | $this->profileIn( '-total' ); |
58 | 58 | } |
— | — | @@ -163,7 +163,7 @@ |
164 | 164 | |
165 | 165 | function getCallTreeLine($entry) { |
166 | 166 | list ($fname, $level, $start, $x, $end) = $entry; |
167 | | - $delta = $this->microDelta($start, $end); |
| 167 | + $delta = $end - $start; |
168 | 168 | $space = str_repeat(' ', $level); |
169 | 169 | |
170 | 170 | # The ugly double sprintf is to work around a PHP bug, |
— | — | @@ -173,18 +173,8 @@ |
174 | 174 | $space, $fname ); |
175 | 175 | } |
176 | 176 | |
177 | | - function micro2Float( $micro ) { |
178 | | - list( $whole, $fractional ) = explode( ' ', $micro ); |
179 | | - return (float)$whole + (float)$fractional; |
180 | | - } |
181 | | - |
182 | | - function microDelta( $start, $end ) { |
183 | | - return $this->micro2Float( $end ) - |
184 | | - $this->micro2Float( $start ); |
185 | | - } |
186 | | - |
187 | 177 | function getTime() { |
188 | | - return microtime(); |
| 178 | + return microtime(true); |
189 | 179 | #return $this->getUserTime(); |
190 | 180 | } |
191 | 181 | |
— | — | @@ -217,10 +207,8 @@ |
218 | 208 | foreach ($this->mStack as $entry) { |
219 | 209 | $fname = $entry[0]; |
220 | 210 | $thislevel = $entry[1]; |
221 | | - $start = explode(' ', $entry[2]); |
222 | | - $start = (float) $start[0] + (float) $start[1]; |
223 | | - $end = explode(' ', $entry[4]); |
224 | | - $end = (float) $end[0] + (float) $end[1]; |
| 211 | + $start = $entry[2]; |
| 212 | + $end = $entry[4]; |
225 | 213 | $elapsed = $end - $start; |
226 | 214 | $memory = $entry[5] - $entry[3]; |
227 | 215 | |
— | — | @@ -240,10 +228,8 @@ |
241 | 229 | foreach ($this->mStack as $index => $entry) { |
242 | 230 | $fname = $entry[0]; |
243 | 231 | $thislevel = $entry[1]; |
244 | | - $start = explode(' ', $entry[2]); |
245 | | - $start = (float) $start[0] + (float) $start[1]; |
246 | | - $end = explode(' ', $entry[4]); |
247 | | - $end = (float) $end[0] + (float) $end[1]; |
| 232 | + $start = $entry[2]; |
| 233 | + $end = $entry[4]; |
248 | 234 | $elapsed = $end - $start; |
249 | 235 | |
250 | 236 | $memory = $entry[5] - $entry[3]; |