Skip to content

Commit 25a5bdc

Browse files
committed
Add stat_runner.
1 parent 5e0682a commit 25a5bdc

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

python/stat_runner.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#! /usr/bin/env python3
2+
3+
import subprocess
4+
import sys
5+
6+
if __name__ == "__main__":
7+
if len(sys.argv) != 3:
8+
print("Usage: python3 %s <script.package.path> <iters>" % __file__)
9+
exit(1)
10+
else:
11+
running_sum = 0
12+
limit = int(sys.argv[2])
13+
14+
for _ in range(limit):
15+
out = subprocess.run(["python3", "-m", sys.argv[1]], stdout=subprocess.PIPE)
16+
running_sum += float(out.stdout)
17+
18+
print("Mean: %s" % (running_sum / limit))

0 commit comments

Comments
 (0)