summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2018-08-31 11:44:08 +0200
committerTom Smeding <tom.smeding@gmail.com>2018-08-31 11:44:08 +0200
commitaaa342471b02cc283c83e44829ecb1bae7a7beeb (patch)
treef82b4828d1e02949d582d9faaa5a207f309701de
parentaa8c92d0cb854dcc93d7f9076285332417354889 (diff)
Add timings collect script
-rwxr-xr-xtimings.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/timings.py b/timings.py
new file mode 100755
index 0000000..7ee491b
--- /dev/null
+++ b/timings.py
@@ -0,0 +1,24 @@
+#!/usr/bin/env python3
+import sys, os
+
+def safeChar(c):
+ if c.isalnum():
+ return c
+ else:
+ return "_{:02X}".format(ord(c))
+
+name = sys.argv[1]
+safename = "".join(safeChar(c) for c in name)
+
+for fname in os.listdir("comp_cache"):
+ parts = fname.split(".")[0].split("-")
+ if safename in parts[0:2]:
+ with open("comp_cache/" + fname) as f:
+ contents = f.read().strip()
+
+ if safename == parts[0]:
+ timing = contents.split()[3]
+ else:
+ timing = contents.split()[4]
+
+ print(timing)