For a particular optimization task it is sought to have the optimization finished before a particular time threshold. For this reason it is defined property 'MaxTime' as follows,
options = optimoptions('patternsearch', 'Display', 'final', 'MaxTime', 0.01, 'MaxFunctionEvaluations', 10);
However, it takes considerably longer time to finish the optimization task than the specified time of 0.01 seconds.
Why are the computations take longer computational time as the one set in property 'MaxTime' throughout the iterations when using functions from the Optimization Toolbox?