diff options
-rw-r--r-- | scripts/simplebench/simplebench.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/simplebench/simplebench.py b/scripts/simplebench/simplebench.py index 0a3035732c..27bc4d4715 100644 --- a/scripts/simplebench/simplebench.py +++ b/scripts/simplebench/simplebench.py @@ -83,7 +83,10 @@ def bench_one(test_func, test_env, test_case, count=5, initial_run=True, dim = 'seconds' result['dimension'] = dim result['average'] = statistics.mean(r[dim] for r in succeeded) - result['stdev'] = statistics.stdev(r[dim] for r in succeeded) + if len(succeeded) == 1: + result['stdev'] = 0 + else: + result['stdev'] = statistics.stdev(r[dim] for r in succeeded) if len(succeeded) < count: result['n-failed'] = count - len(succeeded) |