From eaf12101484aa0f4f144a10094f1bbd2e0f2fa59 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 17 Aug 2005 20:07:07 +0000 Subject: [PATCH] Committing live hack: don't adjust for times where elapsed is 0 --- includes/Profiling.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/includes/Profiling.php b/includes/Profiling.php index 1fb1ae0e04..634735cdff 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)) { -- 2.20.1