Elapsed Timer (print elapsed time)

version 1.2.0.0 (1.71 KB) by Matt Caywood
Simple, useful utility for printing elapsed time and remaining time in a lengthy loop computation.

757 Downloads

Updated 5 Aug 2010

View License

A smarter version of the built-in functions tic and toc, made for iterative/loop computations.

Using it is just as simple:
etimer = elapsedtimer;

(then after each step)
steptimer(etimer);

After each step, prints out something like:

Elapsed time: 00:01:54 Time per step: 00:00:10 Time remaining: 00:00:25

To display time remaining, it needs to know the number of steps in the computation.
You can also set it to only print out every nth step, for example every 1000 steps.

Cite As

Matt Caywood (2022). Elapsed Timer (print elapsed time) (https://www.mathworks.com/matlabcentral/fileexchange/28247-elapsed-timer-print-elapsed-time), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2009a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!