From 158e726dc77162cc6561e4f08c08c87850af91b9 Mon Sep 17 00:00:00 2001 From: Darren Ranalli Date: Tue, 21 Oct 2008 02:23:01 +0000 Subject: [PATCH] prevent false positives caused by zero-duration profiles --- direct/src/task/TaskProfiler.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/direct/src/task/TaskProfiler.py b/direct/src/task/TaskProfiler.py index bb788cbe86..c21432f504 100755 --- a/direct/src/task/TaskProfiler.py +++ b/direct/src/task/TaskProfiler.py @@ -46,8 +46,13 @@ class TaskTracker: self.notify.info(s) return isSpike def addProfileSession(self, session): - isSpike = self._checkSpike(session) duration = session.getDuration() + if duration == 0.: + # profiled code was too fast for the clock, throw this result out + # if we keep it we may get many false positive spike detects + return + + isSpike = self._checkSpike(session) self._durationAverager.addValue(duration) storeAvg = True