diff options
author | Tom Smeding <tom.smeding@gmail.com> | 2018-08-31 11:44:08 +0200 |
---|---|---|
committer | Tom Smeding <tom.smeding@gmail.com> | 2018-08-31 11:44:08 +0200 |
commit | aaa342471b02cc283c83e44829ecb1bae7a7beeb (patch) | |
tree | f82b4828d1e02949d582d9faaa5a207f309701de | |
parent | aa8c92d0cb854dcc93d7f9076285332417354889 (diff) |
Add timings collect script
-rwxr-xr-x | timings.py | 24 |
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) |