No BSD License
Highlights from
timetic
timetic
by David Gleich
27 Sep 2006
(Updated 27 Sep 2006)
An object oriented implementation of tic and toc for nested timing.
|
Watch this File
|
| File Information |
| Description |
The tic and toc functions manipulate a single global time variable and are not suitable for internal function timing when external routines may also perform independent timing.
The timetic object rectifies this deficiency in Matlab and creates a proper object-oriented timing class.
t1 = timetic;
tic(t1);
% compute
t2 = timetic;
tic(t2);
% compute
toc(t2)
% compute
toc(t1)
The times reported by the two toc commands are precisely the times between the tic and toc commands.
Further, the timetic class extends the tic/toc paradigm by adding pause, start, and set operations to manipulate a timer.
tt = timetic;
tic(t1);
pause(t1);
% do some complicated output
start(t1); % restarts t1 without resetting the total elapsed time
toc(t1); |
| MATLAB release |
MATLAB 7 (R14)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (3) |
| 19 Oct 2006 |
master user
|
|
|
| 22 Feb 2008 |
alex barnett
|
|
|
| 21 Oct 2009 |
Jan Simon
|
|
|
|
Contact us at files@mathworks.com