      SUBROUTINE TIMEIT(CMSGTM,DTIME)
C
C     timeit_titan
C
C This version of TIMEIT is for Titan computers.
C
c history
C 94.06.20 (PJF) add dtime to the formal parameters
C 04.04.05 (BTD) changed IF(CMSGTM(1:7).NE.. to IF(CMSGTM.NE..
c end history
C Copyright (C) 1993,1994,2004 B.T. Draine and P.J. Flatau
C This code is covered by the GNU General Public License.
C***********************************************************************
C     .. Scalar Arguments ..
      CHARACTER CMSGTM* (*)
C     ..
C     .. Local Scalars ..
      REAL DTIME, OLDTIM, TIME
      INTEGER IAD
      CHARACTER CSTA*3, CMSGNM*70
C     ..
C     .. External Subroutines ..
      EXTERNAL WRIMSG
C     ..
C     .. External Functions ..
      REAL CPUTIM
      EXTERNAL CPUTIM
C     ..
C     .. Data statements ..
      DATA CSTA/'ONE'/
C     .. 
      IF(CSTA.EQ.'ONE')THEN
         CSTA='TWO'
         OLDTIM=CPUTIM(0.)
      ELSEIF(CSTA.EQ.'TWO')THEN
         CSTA='ONE'
         TIME=CPUTIM(0.)
         IF(CMSGTM.NE.'NOPRINT'.AND.CMSGTM.NE.'noprint')THEN
            WRITE(CMSGNM,FMT='(A,A)')' Timing results for: ',CMSGTM
            CALL WRIMSG('TIMEIT',CMSGNM)
            WRITE(CMSGNM,FMT='(G15.6, A)')DTIME,' CPU time (in secs) '
            CALL WRIMSG('TIMEIT',CMSGNM)
         ENDIF
      ENDIF
      RETURN
      END
