I just noticed that the results are quite different when using Run an Time. With the code below, the results are:
- test>counter: 1.055 s
- test>equation1: 0.097 s
- test>equation2: 0.077 s
I guess in such situations, tic toc and timeit are more accurate measurements than the profiler.
N = 10^7;
step = 0.123456789;
out1 = equation1(step, N);
out2 = equation2(step, N);
out3 = counter(step, N);
% Functions under test
same as in the original post