if ($wgDebugFunctionEntry) {
$this->debug(str_repeat(' ', count($this->mWorkStack)).'Entering '.$functionname."\n");
}
- $this->mWorkStack[] = array($functionname, count( $this->mWorkStack));
+ $this->mWorkStack[] = array($functionname, count( $this->mWorkStack),microtime(true));
}
function profileOut($functionname) {
$this->debug(str_repeat(' ', count($this->mWorkStack) - 1).'Exiting '.$functionname."\n");
}
- list($ofname, /* $ocount */ ,$ortime,$octime) = array_pop($this->mWorkStack);
+ list($ofname, /* $ocount */ ,$ortime) = array_pop($this->mWorkStack);
if (!$ofname) {
$this->debug("Profiling error: $functionname\n");
$message = "Profile section ended by close(): {$ofname}";
$functionname = $ofname;
$this->debug( "$message\n" );
+ $this->mCollated[$message] = array(
+ 'real' => 0.0, 'count' => 1);
}
elseif ($ofname != $functionname) {
$message = "Profiling error: in({$ofname}), out($functionname)";
$this->debug( "$message\n" );
+ $this->mCollated[$message] = array(
+ 'real' => 0.0, 'count' => 1);
}
$entry =& $this->mCollated[$functionname];
$elapsedreal = microtime(true) - $ortime;