diff options
author | David Robillard <d@drobilla.net> | 2023-04-03 09:00:36 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-04-06 07:19:10 -0400 |
commit | ab712f8f0ea58f1a36aced42332ed8d8ffab83d7 (patch) | |
tree | 683a177c8203fde3c200ba3b1bf258e281a14a8e /scripts/serd_bench.py | |
parent | 1c9d83c0c449ce6e62631985ae0c2b415345c3a8 (diff) | |
download | serd-ab712f8f0ea58f1a36aced42332ed8d8ffab83d7.tar.gz serd-ab712f8f0ea58f1a36aced42332ed8d8ffab83d7.tar.bz2 serd-ab712f8f0ea58f1a36aced42332ed8d8ffab83d7.zip |
Fix flake8 warnings and add test
Diffstat (limited to 'scripts/serd_bench.py')
-rwxr-xr-x | scripts/serd_bench.py | 5 |
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) |