Measure time required to run function
t = timeit(
measures the time (in seconds)
required to run the function specified by the function handle f
)f
.
In order to perform a robust measurement, timeit
calls the
specified function multiple times and returns the median of the measurements. If the
function runs fast, timeit
might call the function many
times.
t = timeit(
calls f
,numOutputs
)f
with
the desired number of outputs, numOutputs
. By default, timeit
calls
the function f
with one output (or no outputs,
if the function does not return any outputs).
The following actions result in unexpected output:
timeit
between tic
and toc
timeit
to time a function
that includes calls to tic
and toc
timeit
recursively