Skip to content

Commit

Permalink
Output parse rate in benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Sep 10, 2024
1 parent f586d61 commit 3769bf0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def timeit(func, number=1):
def doit(name, func, num=20):
print('Parsing', num, 'times with', name)
t = timeit(func, num)
print(name, 'took an average of: {:,.3f} seconds to parse it'.format(t))
rate = len(raw) / t
print(name, f'took an average of: {t:,.3f} seconds to parse it @ {rate/1000:.1f} KB/s')
return t


Expand Down

0 comments on commit 3769bf0

Please sign in to comment.