cmark
My personal build of CMark ✏️
stats.py (491B)
1 #!/usr/bin/env python3 2 3 import sys 4 import statistics 5 6 def pairs(l, n): 7 return zip(*[l[i::n] for i in range(n)]) 8 9 # data comes in pairs: 10 # n - time for running the program with no input 11 # m - time for running it with the benchmark input 12 # we measure (m - n) 13 14 values = [ float(y) - float(x) for (x,y) in pairs(sys.stdin.readlines(),2)] 15 16 print("mean = %.4f, median = %.4f, stdev = %.4f" % 17 (statistics.mean(values), statistics.median(values), 18 statistics.stdev(values))) 19