Two functions ETIME and DTIME. let FORTRAN programs measure time. This is useful for perfomance tuning. They are used as follows:

REAL TIMEARRAY (2)

REAL ELAPSE

REAL DEI.APSE

ELAPSE = ETIME(TIMEARRAY)

DELAPSE=DTIME (TIMEARRAY)

ETIME returns a real number which is the total CPU time used for this process it began executing. DTIME returns a real number which is the running time for this process since the last call to DTIME. Both procedures use TIMEARRAY to return the user time and system time separately; TIMEARRAY(1) reports the user time, and TIMEARRAY(2) supports the system time. For example, the statements

REAL DELAPSE TIMEARRAY(2), X

INTEGER I

X=1

DELAPSE =DTIME(TIMEARRAY)

DO 10 I=1, 100000

X=X+1/X

10 CONTINUE

DELAPSE=DTIME (TIMEARRAY)

set DELAPSE to the time required to compute the loop DO 10 1=1,100000.

^{[1]}
Mike Loukides, **UNIX
for FORTRAN Programmers, **O’ Reilly and Associates, Inc, 103 Morris
Street, Sebastopol, CA 95472, (1990, 1991) see page 89