diff options
Diffstat (limited to 'includes/Profiling.php')
-rwxr-xr-x | includes/Profiling.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/includes/Profiling.php b/includes/Profiling.php index 770f39fedd3b..2fe5adab3b75 100755 --- a/includes/Profiling.php +++ b/includes/Profiling.php @@ -245,10 +245,12 @@ class Profiler { $subcalls = $this->calltreeCount($this->mStack, $index); if (!preg_match('/^-overhead/', $fname)) { - # Adjust for profiling overhead - $elapsed -= $overheadInternal; - $elapsed -= ($subcalls * $overheadTotal); - $memory -= ($subcalls * $overheadMemory); + # Adjust for profiling overhead (except special values with elapsed=0 + if ( $elapsed ) { + $elapsed -= $overheadInternal; + $elapsed -= ($subcalls * $overheadTotal); + $memory -= ($subcalls * $overheadMemory); + } } if (!array_key_exists($fname, $this->mCollated)) { |