                            dBASE III Timer
                  (PC World Star-Dot-Star July 1985)

     dBASE III has several functions and field types not available in
dBASE II.  The TIME() function can be used to set up a timer, as shown
in TIMER.PRG.  This small program can be run from within dBASE III.
Type START = TIME() <Enter> to begin timing; type END = TIME() <Enter>
to indicate the end of the interval to be measured.  The command DO
TIMER will execute the program, which will clear the screen and display
the date and the elapsed time in "Saturday: March 16, 1985" format.  By
issuing the DO TIMER command at various points, START can be stated
once and END stated several times to time several different aspects of
a program.

* TIMER.PRG.  Assumes calling program executes START = TIME()
* and END = TIME() prior to DO TIMER.

SET TALK OFF
STORE .T. TO GONOGO
DO WHILE GONOGO
HOUR1 = VAL(START)
HOUR2 = VAL(END)
MIN1 = VAL(SUBSTR(START,4,2))
MIN2 = VAL(SUBSTR(END,4,2))
SEC1 = VAL(SUBSTR(START,7,2))
SEC2 = VAL(SUBSTR(END,2,2))
ELAPHR = HOUR2 - HOUR1
IF MIN2 > MIN1
  ELAPMIN = MIN2 - MIN1
ELSE
  ELAPMIN = 60 - MIN1 + MIN2
  ELAPHR = ELAPHR - 1
ENDIF
IF SEC2 > SEC1
  ELAPSEC = SEC2 - SEC1
ELSE
  ELAPSEC = 60 - SEC1 + SEC2
  ELAPMIN = ELAPMIN -1
ENDIF
ELAPSE=STR(ELAPHR,2)+":"+STR(ELA;MIN,2)+":"+STR(ELAPSEC,2)
DDAY = CDOW(DATE()) + ":  "
DDATE=CMONTH(DATE())+STR(DAY(DATE()),3)+","+STR(YEAR(DATE()),5)
HDR = DDAY + DDATE
CLEAR
@ 3,10 SAY HDR
@ 5,10 SAY "Elapsed time was "
@ 5,28 SAY ELAPSE
STORE .F. TO GONOGO
ENDDO
