def time_it(func, calls, *args, **kwargs):
<EOL>times = []<EOL>for call_index in range(calls):<EOL><INDENT>start_time = time.time()<EOL>func(*args, **kwargs)<EOL>times.append(time.time() - start_time)<EOL><DEDENT>times.sort()<EOL>best = times[<NUM_LIT:0>]<EOL>worst = times[-<NUM_LIT:1>]<EOL>average = sum(times) / float(len(times))<EOL>print(<EOL>'<STR_LIT>'.format(<EOL>func_name=func.__name__,<EOL>best=best,<EOL>worst=worst,<EOL>average=average<EOL>)<EOL>)<EOL>
Call the given function X times and output the best, worst and average
execution time.