/**
* Begin profiling of a function
- * @param $functioname name of the function we will profile
+ * @param $functionname name of the function we will profile
*/
function wfProfileIn( $functionname ) {
global $wgProfiler;
/**
* Stop profiling of a function
- * @param $functioname name of the function we have profiled
+ * @param $functionname name of the function we have profiled
*/
function wfProfileOut( $functionname = 'missing' ) {
global $wgProfiler;
/**
* Returns a profiling output to be stored in debug file
*
- * @param float $start
- * @param float $elapsed time elapsed since the beginning of the request
+ * @param $start Float
+ * @param $elapsed Float: time elapsed since the beginning of the request
*/
function wfGetProfilingOutput( $start, $elapsed ) {
global $wgProfiler;
* called by wfProfileClose()
*/
function close() {
+ global $wgProfiling;
+
+ # Avoid infinite loop
+ if( !$wgProfiling )
+ return;
+
while( count( $this->mWorkStack ) ){
$this->profileOut( 'close' );
}
wfProfileOut( '-overhead-total' );
# First, subtract the overhead!
+ $overheadTotal = $overheadMemory = $overheadInternal = array();
foreach( $this->mStack as $entry ){
$fname = $entry[0];
$start = $entry[2];