Skip to content

Instantly share code, notes, and snippets.

@akahana-1
Last active August 29, 2015 14:02
Show Gist options
  • Save akahana-1/e70f308946ce122acd58 to your computer and use it in GitHub Desktop.
Save akahana-1/e70f308946ce122acd58 to your computer and use it in GitHub Desktop.
#! /usr/bin/env python3
# -*- coding:utf-8 -*-
import subprocess
#import csv
import random
import time
import matplotlib.pyplot as plot
efiles = ["./a.out {0} {1}", "python3 prime.py {0} {1}"]
query = reversed(sorted([int(10**(x/2) * random.random()) for x in range(4, 15)]))
for x in range(3, 4):
for command in efiles:
t = []
for q in query:
print(q)
stime = time.process_time()
subprocess.call(command.format(x, q).split(), stdout=subprocess.DEVNULL)
etime = time.process_time()
t.append(etime - stime)
print(etime - stime)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment