Skip to content

toc

Read the elapsed time from a tic.

toc
t = toc
t = toc(tStart)

Returns the elapsed wall-clock time in seconds since the matching tic. Without a return value, prints the elapsed time. With a tStart argument from tic, reads that specific timer.

tic; for i=1:1000; end; toc
  • tic — Start a timer.
  • clock — Current date and time as a 6-element vector.