From: Tim Starling Date: Tue, 6 Dec 2005 13:08:51 +0000 (+0000) Subject: Measurement of the pre-profile setup time X-Git-Tag: 1.6.0~1006 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/modifier.php?a=commitdiff_plain;h=526fd17ca76fcdf283fdf00837d50534045eb411;p=lhc%2Fweb%2Fwiklou.git Measurement of the pre-profile setup time --- diff --git a/includes/Profiling.php b/includes/Profiling.php index 8bb794589a..6dc007cb48 100755 --- a/includes/Profiling.php +++ b/includes/Profiling.php @@ -44,14 +44,19 @@ if (!function_exists('memory_get_usage')) { class Profiler { var $mStack = array (), $mWorkStack = array (), $mCollated = array (); var $mCalls = array (), $mTotals = array (); - /* + function Profiler() { - $this->mProfileStack = array(); - $this->mWorkStack = array(); - $this->mCollated = array(); + // Push an entry for the pre-profile setup time onto the stack + global $wgRequestTime; + if ( !empty( $wgRequestTime ) ) { + $this->mWorkStack[] = array( '-total', 0, $wgRequestTime, 0 ); + $this->mStack[] = array( '-setup', 1, $wgRequestTime, 0, microtime(), 0 ); + } else { + $this->profileIn( '-total' ); + } + } - */ function profileIn($functionname) { global $wgDebugFunctionEntry; @@ -349,5 +354,5 @@ class Profiler { } $wgProfiler = new Profiler(); -$wgProfiler->profileIn('-total'); + ?>