From: Brion Vibber Date: Wed, 17 Aug 2005 20:07:07 +0000 (+0000) Subject: Committing live hack: don't adjust for times where elapsed is 0 X-Git-Tag: 1.6.0~1908 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/bilan.php?a=commitdiff_plain;h=eaf12101484aa0f4f144a10094f1bbd2e0f2fa59;p=lhc%2Fweb%2Fwiklou.git Committing live hack: don't adjust for times where elapsed is 0 --- 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)) {