Index: trunk/phase3/includes/Profiling.php |
— | — | @@ -44,14 +44,19 @@ |
45 | 45 | class Profiler { |
46 | 46 | var $mStack = array (), $mWorkStack = array (), $mCollated = array (); |
47 | 47 | var $mCalls = array (), $mTotals = array (); |
48 | | - /* |
| 48 | + |
49 | 49 | function Profiler() |
50 | 50 | { |
51 | | - $this->mProfileStack = array(); |
52 | | - $this->mWorkStack = array(); |
53 | | - $this->mCollated = array(); |
| 51 | + // Push an entry for the pre-profile setup time onto the stack |
| 52 | + global $wgRequestTime; |
| 53 | + if ( !empty( $wgRequestTime ) ) { |
| 54 | + $this->mWorkStack[] = array( '-total', 0, $wgRequestTime, 0 ); |
| 55 | + $this->mStack[] = array( '-setup', 1, $wgRequestTime, 0, microtime(), 0 ); |
| 56 | + } else { |
| 57 | + $this->profileIn( '-total' ); |
| 58 | + } |
| 59 | + |
54 | 60 | } |
55 | | - */ |
56 | 61 | |
57 | 62 | function profileIn($functionname) { |
58 | 63 | global $wgDebugFunctionEntry; |
— | — | @@ -349,5 +354,5 @@ |
350 | 355 | } |
351 | 356 | |
352 | 357 | $wgProfiler = new Profiler(); |
353 | | -$wgProfiler->profileIn('-total'); |
| 358 | + |
354 | 359 | ?> |