count = 10, 100, 1000, 10000
for each value of count, i need to execute the method 5 times using timeit and print out the min value and the actual 5 values.
numstring contains four functions in it.
output should look like (a total of 16 lines):
numbers_string1, count = 10, min = 0.0001, actuals = [0.0001, 0.0002, 0.0001, ...]
numbers_string1, count = 100, min = 0.002, actuals = [0.002, 0.002, 0.003, ...]
....
numbers_string4, count = 10000, min = 0.1 actuals = [....]
For this i tried this way:
My Code:
from numstring import *
import timeit
def profile_timeit():
funcs_list = [numbers_string1, numbers_string2, numbers_string3, num_strings4]
for i in funcs_list:
for count in [10, 100, 1000, 10000]:
actuals = timeit.timeit(stmt='i(count)', number=4, setup='from __main__ import *')
print "{0} count = {1} \t min = {2} \t actuals = {3}".format(i, count, min(actuals), actuals)
print "\n"
if __name__ == "__main__":
profile_timeit()
can anybody please help me out. Thanks in advance