C+ C NAME: C StopWatchSub C PURPOSE: C Clock the time elapsed since given start time C CALLING SEQUENCE: subroutine StopWatchSub(cStart,cStop,cLapsed) C INPUTS: C cStart character*(*) read-only start time string; absolute time C cStop character*(*) (optional) stop time string C special input: cStop = ' ' and cStop = '_' C OUTPUTS: C cStop character*(*) current time string C LAPSED character*(*) time difference string C format DDD HH:MM:SS.SS C CALLS: C Time2System, Time2Str, Time2Split, Time2Delta C RESTRICTIONS: C There is no check whether the input times are in the proper absolute C time format. If not, all bets are off. C PROCEDURE: C > The input and (optional) stop time must be specified as absolute times, C in the format specified in argument cFmt. C > if the input string cStop = ' ' or cStop = '_' then the stop time is C obtained using Time2System C > if cStop = ' ' the stop time is not returned, i.e. cStop is used read-only C > if cStop = '_' the stop time is returned C > the time difference is returned in the form DDD HH:MM:SS.SS. C If the number of days DDD=0 the DDD part is filled with blanks. C MODIFICATION HISTORY: C JAN-1993, Paul Hick (UCSD/CASS) C Original written in Lindau. C NOV-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu) C Rewritten using Time2* routines. C- character cStart *(*) character cStop *(*) character cLapsed*(*) integer t(4) integer u(2) integer Time2Str if (cStop .eq. ' ') then call Time2System(u) else if (cStop .eq. '_') then call Time2System(u) i = Time2Str(' ',u,cStop) else call Time2Split(' ',cStop,u) end if call Time2Split(' ',cStart,t) call Time2Delta(u,t,t) iday = t(1) t(1) = 0 cLapsed = ' ' if (t(1) .ne. 0) write (cLapsed,'(I3)') t(1) i = Time2Str('hh:mm:ss',t,cLapsed(5:)) return end