I have multiple functions and I want to measure the performance of each and store elapsed time in a list. I am a bit confused about running these functions in the time measure function:
def time_measure(function):
import time
t = time.process_time()
# run function here
elapsed_time = time.process_time() - t
output = []
output.append(elapsed time)
return output
or I think I can just run time_measure
for each of the functions and get the time measurements separately. I have five functions to run.
How do I run the function within the time_measure
function, and set the function as a parameter?