summaryrefslogtreecommitdiff
path: root/hacks
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-06-03 22:23:58 +0200
committerCarl Hetherington <cth@carlh.net>2023-06-03 22:24:12 +0200
commit00734ea5fe3f6946de02e6d9ec3e786c67bae4da (patch)
tree47d9a41e616db581c7d81969072069ffa7e33c21 /hacks
parent4ff0aa901f03b4da08054b7b27e4bfba2152785b (diff)
Tweak test timing hack script to accept stdin.
Diffstat (limited to 'hacks')
-rwxr-xr-xhacks/test_timings22
1 files changed, 11 insertions, 11 deletions
diff --git a/hacks/test_timings b/hacks/test_timings
index 932fb395f..05c680513 100755
--- a/hacks/test_timings
+++ b/hacks/test_timings
@@ -3,20 +3,20 @@
import sys
if len(sys.argv) < 2:
- print('Syntax %s <log>' % sys.argv[0], file=sys.stderr)
- sys.exit(1)
+ file = sys.stdin
+else:
+ file = open(sys.argv[1])
tests = {}
-with open(sys.argv[1]) as f:
- while True:
- l = f.readline()
- if l == '':
- break
+while True:
+ l = file.readline()
+ if l == '':
+ break
- s = l.split()
- if len(s) == 8 and s[7][-2:] == 'us':
- tests[float(s[7][:-2]) / 1000000] = s[4][1:-2]
+ s = l.split()
+ if len(s) == 8 and s[7][-2:] == 'us':
+ tests[float(s[7][:-2]) / 1000000] = s[4][1:-2]
for t in sorted(tests):
s = int(t)
@@ -24,4 +24,4 @@ for t in sorted(tests):
s -= h * 3600
m = s // 60
s -= m * 60
- print("%30s %02d:%02d:%02d (%f)" % (tests[t], h, m, s, t))
+ print("%50s %02d:%02d:%02d (%f)" % (tests[t], h, m, s, t))