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 (c) 1984-98 by The MathWorks, Inc.
%   $Revision: 5.6 $  $Date: 1998/05/13 00:20:24 $

% 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
