> timeit('sorter( array, size )', number=1)
I'm not a timeit whiz, but I'm kind of surprised there isn't a call form
where it goes something like
timeit(callable, *args, ...)
There is a globals keyword argument though. I think you could probably call
it with globals=locals() in your case
Trying to use timeit within a function:
def test(name, sorter, size):
"""Tests and times the sorting algorithm on given array size"""
print(name,end='\t')
array = [0]*size
for i in range(size):
array[i] = randrange(20)
timeit('sorter( array, size )', number=1)