<< time | Time functions | toc >> |
t = timeit(f) |
t = timeit(f, nLhs) |
t = timeit(f, nLhs, x1, ..., xm) |
Function handle: Function to run.
integer value: number of output arguments. (1: default)
Input arguments, specified as a comma-separated list of variables or expressions.
time (in seconds).
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.
f = str2func('@()sleep(6)');
tic();t = timeit(f), toc()
X = rand(100);
f = str2func('@(X) svd(X);');
tic(), t1 = timeit(f, 1, X), toc()
tic(), t2 = timeit(f, 3, X), toc()
tic.
Version | Description |
---|---|
1.0.0 | initial version |
Allan CORNET