Skip to content

tic

Start a timer.

tic
tStart = tic

Records the current time. Pair with toc to measure elapsed wall-clock time. With a return value, returns a timer ID that can be passed to toc later — useful for nested or concurrent timing.

tic; pause(2); toc % prints '~2.0s'
t1 = tic; ... toc(t1) % nested timing
  • toc — Read the elapsed time from a tic.
  • clock — Current date and time as a 6-element vector.
  • now — Current date and time as a serial date-time number.