mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-10-28 08:08:58 +00:00
Add error message
This commit is contained in:
1 parent
5a3fc3c92a
commit
071d5c6993
1 file changed
+7
-2
@@ -2,15 +2,20 @@
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import sys
|
||||
from scipy import stats
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("file", help="JSON file with benchmark results")
|
||||
parser.add_argument("file", help="JSON file with two benchmark results")
|
||||
args = parser.parse_args()
|
||||
|
||||
with open(args.file) as f:
|
||||
results = json.load(f)["results"]
|
||||
|
||||
if len(results) != 2:
|
||||
print("The input file has to contain exactly two benchmarks")
|
||||
sys.exit(1)
|
||||
|
||||
a, b = [x["command"] for x in results[:2]]
|
||||
X, Y = [x["times"] for x in results[:2]]
|
||||
|
||||
@@ -25,4 +30,4 @@ print("p < {} = {}\n".format(th, dispose))
|
||||
if dispose:
|
||||
print("There is a difference between the two benchmarks.")
|
||||
else:
|
||||
print("The two benchmarks are almost the same.")
|
||||
print("The two benchmarks are almost the same.")
|
||||
Reference in new issue
Block a user