function_to_test(test, mylist): #test as an int, mylist as a list of int
do_something
return something
function_generates_a_list(min, max): #min, max are int
do_something
return a_List
I need to timeit the function_to_test and only this one. The purpose is to test code in order to determine which one is the best to test if a int is in a list of int. (test is a googolplex and mylist is a huge list starting from min to max). Yes, I already know the result of the function, I need to know how many times it will cost.
My problem is: which syntax have I to use with timeit if I want to pass a global list as a local parameter of a function I test?
listas a variable name.function_generates_a_list()has not to be tested. It simply generates the list wich is necessary tofunction_to_testwich has been to be timed.intthat contains a googolplex. That would require, uh, quite a bit of storage.