mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-10-28 08:08:58 +00:00
Update formatting, use f-strings
This commit is contained in:
1 parent
b0d29f01b0
commit
65dd84fb07
5 files changed
+49
-46
No files matched your search
@@ -20,19 +20,19 @@ 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]]
|
||||
a, b = (x["command"] for x in results[:2])
|
||||
X, Y = (x["times"] for x in results[:2])
|
||||
|
||||
print("Command 1: {}".format(a))
|
||||
print("Command 2: {}\n".format(b))
|
||||
print(f"Command 1: {a}")
|
||||
print(f"Command 2: {b}\n")
|
||||
|
||||
t, p = stats.ttest_ind(X, Y, equal_var=False)
|
||||
th = 0.05
|
||||
dispose = p < th
|
||||
print("t = {:.3}, p = {:.3}".format(t, p))
|
||||
print(f"t = {t:.3}, p = {p:.3}")
|
||||
print()
|
||||
|
||||
if dispose:
|
||||
print("There is a difference between the two benchmarks (p < {}).".format(th))
|
||||
print(f"There is a difference between the two benchmarks (p < {th}).")
|
||||
else:
|
||||
print("The two benchmarks are almost the same (p >= {}).".format(th))
|
||||
print(f"The two benchmarks are almost the same (p >= {th}).")
|
||||
Reference in new issue
Block a user