Skip to content

Commit 3769bf0

Browse files
committed
Output parse rate in benchmark
1 parent f586d61 commit 3769bf0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

benchmark.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ def timeit(func, number=1):
4646
def doit(name, func, num=20):
4747
print('Parsing', num, 'times with', name)
4848
t = timeit(func, num)
49-
print(name, 'took an average of: {:,.3f} seconds to parse it'.format(t))
49+
rate = len(raw) / t
50+
print(name, f'took an average of: {t:,.3f} seconds to parse it @ {rate/1000:.1f} KB/s')
5051
return t
5152

5253

0 commit comments

Comments
 (0)