      SUBROUTINE TIMEIT(CMSGTM,DTIME)
C
C     timeit_vms
C 94.06.20 (PJF) add dtime to the formal parameters
C 96.06.19 (PJF) modified to suppress printing if CMSGTM='noprint'
C This version of TIMEIT is for VMS systems.
C
C Copyright (C) 1993,1995 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 LIB$INIT_TIMER, LIB$SHOW_TIMER, WRIMSG
C     ..
C     .. Data statements ..
      DATA CSTA/'ONE'/
C     ..
      IF(CSTA.EQ.'ONE')THEN
         CSTA='TWO'
         IAD=0
         CALL LIB$INIT_TIMER(IAD)
      ELSEIF(CSTA.EQ.'TWO')THEN
         CSTA='ONE'
         IF(CMSGTM(1:7).NE.'NOPRINT'.AND.CMSGTM(1:7).NE.'noprint')THEN
            CALL LIB$SHOW_TIMER(IAD,2)
            WRITE(CMSGNM,FMT='(A,A)')' Timing results for: ',CMSGTM
            CALL WRIMSG('TIMEIT',CMSGNM)
         ENDIF
      ENDIF
      RETURN
      END
