function [] = sumArrayTimeTest()
data = [1:1000];

%time test loop for sum using while loop
startTime = cputime();
for index = [1:100] 
  sumOfArrayLoop(data);
end
endTime = cputime();
time = endTime - startTime;
fprintf('time for while loop sum: %f \n', time);

%time test loop for sum using recursion
startTime = cputime();
for index = [1:100] 
  sumOfArray(data, 1);
end
endTime = cputime();
time = endTime - startTime;
fprintf('time for recursive sum: %f \n', time);

%time test loop for sum using Matlab built-in function
startTime = cputime();
for index = [1:100] 
  sum(data);
end
endTime = cputime();
time = endTime - startTime;
fprintf('time for Matlab built-in sum: %f \n', time);