timeit
Measure time required to run function.
Syntax
t = timeit(f)
t = timeit(f, nLhs)
t = timeit(f, nLhs, x1, ..., xm)
Input argument
f - Function handle: Function to run.
nLhs - integer value: number of output arguments. (1: default)
x1, ..., xm - Input arguments, specified as a comma-separated list of variables or expressions.
Output argument
t - time (in seconds).
Description
t = timeit(f) measures the time elapsed required to run the function specified by the function handle f.
To perform a robust measurement, timeit calls function multiple times and returns the median of the measurements.
If the function runs fast, timeit might call the function many times.
Examples
See also
tic.
History
Version
Description
1.0.0
initial version
Author
Allan CORNET
Last updated