From 8b82451230575c7a0c15392ec0a3680ada760d44 Mon Sep 17 00:00:00 2001 From: Michael McGeagh Date: Fri, 2 Dec 2016 16:34:32 +0000 Subject: [PATCH] util-fps: handle divide by zero possibility --- wlauto/utils/fps.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wlauto/utils/fps.py b/wlauto/utils/fps.py index e16c14e1..84016622 100755 --- a/wlauto/utils/fps.py +++ b/wlauto/utils/fps.py @@ -111,8 +111,9 @@ class FpsProcessor(object): not_at_vsync = self.data.IntendedVsync - self.data.Vsync not_at_vsync = not_at_vsync[not_at_vsync != 0].count() - duration = self.data.Vsync.iloc[-1] - self.data.Vsync.iloc[0] - fps = (1e9 * frame_count) / float(duration) + if frame_count > 1: + duration = self.data.Vsync.iloc[-1] - self.data.Vsync.iloc[0] + fps = (1e9 * frame_count) / float(duration) # If gfxinfocsv is provided, get stats from that instead if self.extra_data: