#3319: don't raise ZeroDivisionError if number of rounds is so

low that benchtime is zero.
This commit is contained in:
Georg Brandl 2008-07-19 13:00:22 +00:00
parent 278fc50c07
commit 59ec315b04
1 changed files with 5 additions and 1 deletions

View File

@ -128,7 +128,11 @@ def Proc0(loops=LOOPS):
IntLoc1 = Proc2(IntLoc1)
benchtime = clock() - starttime - nulltime
return benchtime, (loops / benchtime)
if benchtime == 0.0:
loopsPerBenchtime = 0.0
else:
loopsPerBenchtime = (loops / benchtime)
return benchtime, loopsPerBenchtime
def Proc1(PtrParIn):
PtrParIn.PtrComp = NextRecord = PtrGlb.copy()