Code covered by the BSD License  

Highlights from
Elapsed Timer (print elapsed time)

Be the first to rate this file! 4 Downloads (last 30 days) File Size: 1.71 KB File ID: #28247
image thumbnail

Elapsed Timer (print elapsed time)

by Matt Caywood

 

20 Jul 2010 (Updated 05 Aug 2010)

Simple, useful utility for printing elapsed time and remaining time in a lengthy loop computation.

| Watch this File

File Information
Description

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.

MATLAB release MATLAB 7.8 (R2009a)
Tags for This File  
Everyone's Tags
clock, computation, iteration, loop, performance, stopwatch, timer, timing, user interface, wall clock
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
30 Jul 2010

rewrote object-oriented & simplified

05 Aug 2010

fixed major initialization bug

Contact us