Fix perf node division by zero.

This commit is contained in:
Roz K 2023-01-03 14:10:04 +01:00
parent 78440cce16
commit 4cb67c0d79
Signed by: roz
GPG Key ID: 51FBF4E483E1C822
1 changed files with 4 additions and 3 deletions

View File

@ -56,9 +56,10 @@ class PerfGroup(Group):
self._name = name
def __del__(self):
avg = round(self._total / self._count, 2)
print(self._name, "*", self._count,
": min =", round(self._min, 2), ", max =", round(self._max, 2), ", avg =", avg, "(ms)")
if self._count:
avg = round(self._total / self._count, 2)
print(self._name, "*", self._count,
": min =", round(self._min, 2), ", max =", round(self._max, 2), ", avg =", avg, "(ms)")
def draw(self, time):
begin = thread_time()