timeit
Measure time required to run function
Syntax
t = timeit(f)
t = timeit(f,numOutputs)
Description
t = timeit(
measures the typical time (in seconds) required to run the function specified by the function handlef
)f
.
t = timeit(
callsf
,numOutputs
)f
with the desired number of outputs,numOutputs
. By default,timeit
calls the functionf
with one output (or no outputs, if the function does not return any outputs).
Examples
Input Arguments
Tips
以下操作导致意外输出:
- Using
timeit
betweentic
和toc
- Using
timeit
为了计时一个函数,包括调用tic
和toc
- Using
timeit
recursively
- Using
Algorithms
timeit
多次调用指定功能,并计算测量的中位数。
See Also
Introduced in R2013b
Was this topic helpful?