      SUBROUTINE TIMEIT(CMSGTM,DTIME)
C
C timeit_hp
C
C This version uses the HP-AUX system calls SYSCONF and TIMES
C 94.06.20 (PJF) add dtime to the formal parameters
C 95.06.19 (PJF) modified to suppress printing if CMSGTM='noprint'
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 External system calls:
$ALIAS sysconf = 'sysconf' (%val)
      INTEGER SYSCONF,TIMES
      EXTERNAL SYSCONF,TIMES
C
C Arguments:
      CHARACTER CMSGTM*(*)
C
C Local variables:
      INTEGER*2 NAME
      INTEGER CLK_TCK,I
      INTEGER TMS(4)
      REAL DTIME, OLDTIM
      CHARACTER CSTA*3,CMSGNM*70
C
C External subroutines:
      EXTERNAL WRIMSG

C Data statements:
      DATA CSTA/'ONE'/
C     ..
      IF(CSTA.EQ.'ONE')THEN
         NAME=2
         CLK_TCK=SYSCONF(NAME)
         OLDTIM=REAL(TMS(1)+TMS(2))/REAL(CLK_TCK)
      ELSEIF(CSTA.EQ.'TWO')THEN
         CSTA='ONE'
         I=TIMES(TMS)
         DTIME=REAL(TMS(1)+TMS(2))/REAL(CLK_TCK)-OLDTIM
         IF(CMSGTM(1:7).NE.'NOPRINT'.AND.CMSGTM(1:7).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
