' *** STOPWTCH.LST *** 2nd GFA-Manual, page 3-11 > PROCEDURE stopwatch ' ' *** First call: start stopwatch ' *** Second call: stop stopwatch ' *** Use Procedure Stopwatch_print to print the elapsed time ' ' *** Global : stop.watch% start.watch% watch.on! [for internal use] ' *** s.seconds# s.h& s.m& s.s& [for Stopwatch_print] ' LOCAL s% IF watch.on! stop.watch%=TIMER s.seconds#=SUB(stop.watch%,start.watch%)/200 s.h=DIV(s.seconds#,3600) s%=SUB(s.seconds#,MUL(s.h,3600)) s.m=DIV(s%,60) s.s=SUB(s%,MUL(s.m,60)) watch.on!=FALSE ELSE watch.on!=TRUE start.watch%=TIMER ENDIF RETURN > PROCEDURE stopwatch_print ' ' *** Print elapsed time (from Procedure Stopwatch) at current cursor-position ' ' *** Global: s.seconds# s.h& s.m& s.s& ' IF s.h>0 PRINT s.h;" h ";s.m;" m"; ELSE IF s.m>0 PRINT s.m;" m ";s.s;" s"; ELSE IF s.seconds#>=10 PRINT USING "##.# s",s.seconds#; ELSE PRINT USING "#.## s",s.seconds#; ENDIF ENDIF ENDIF RETURN ' ********* '