function t = toc
%TOC Read the stopwatch timer.
%   TOC, by itself, prints the elapsed time (in seconds) since TIC was used.
%   t = TOC; saves the elapsed time in t, instead of printing it out.
%
%   See also TIC, ETIME, CLOCK, CPUTIME.

%   Copyright 1984-2000 The MathWorks, Inc. 
%   $Revision: 5.9 $  $Date: 2000/06/01 16:09:47 $

% TOC uses ETIME and the value of CLOCK saved by TIC.
global TICTOC
if isempty(TICTOC)
  error('You must call TIC before calling TOC.');
end
if nargout < 1
   elapsed_time = etime(clock,TICTOC)
else
   t = etime(clock,TICTOC);
end
