aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-04-03 09:00:36 -0400
committerDavid Robillard <d@drobilla.net>2023-04-06 07:19:10 -0400
commitab712f8f0ea58f1a36aced42332ed8d8ffab83d7 (patch)
tree683a177c8203fde3c200ba3b1bf258e281a14a8e /scripts
parent1c9d83c0c449ce6e62631985ae0c2b415345c3a8 (diff)
downloadserd-ab712f8f0ea58f1a36aced42332ed8d8ffab83d7.tar.gz
serd-ab712f8f0ea58f1a36aced42332ed8d8ffab83d7.tar.bz2
serd-ab712f8f0ea58f1a36aced42332ed8d8ffab83d7.zip
Fix flake8 warnings and add test
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/serd_bench.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/serd_bench.py b/scripts/serd_bench.py
index 89d34e1f..f3c3e148 100755
--- a/scripts/serd_bench.py
+++ b/scripts/serd_bench.py
@@ -69,10 +69,11 @@ def parse_time(report):
"Return user time and max RSS from a /usr/bin/time -v report"
time = memory = None
for line in report.split("\n"):
+ after_colon = line.find(":") + 1
if line.startswith("\tUser time"):
- time = float(line[line.find(":") + 1 :])
+ time = float(line[after_colon:])
elif line.startswith("\tMaximum resident set"):
- memory = float(line[line.find(":") + 1 :]) * 1024
+ memory = float(line[after_colon:]) * 1024
return (time, memory)