I have a 5 functions defined in a class. In another class I have a multiple looped structure that tries computing the time taken my each of the aforementioned functions on a input file containing many strings.
I want the output such that for each entry of the input file, the average time taken by each function over 10 calls is computed and printed out. So, the output should be like -
inputString | function1AvgTime | f2AvgTime and so on.
I cannot figure out an elegant way to call all these 5 functions 10 times each for a single input string. Right now what i seem to be doing is this -
for (inputString):
for (iteration 1 to 10):
call function 1
for (iteration 1 to 10):
call function2
and so on....
Is there a way to store the function names in an array or some datastructure, and call them within a single iteration loop? My work is getting done anyway. I'm just curious if there is a better design.