C
C     CPUTIM RETURNS ELAPSED USER TIME, T, IN SECONDS.
C     NOTE T IS OF TYPE 'REAL'
C
C     ON THE ALLIANT, INTRINSIC FUNTION ETIME IS CALLED.
C     THE ETIME FUNCTION EXPECTS ITS ARGUEMENT TO BE A 4-BYTE REAL,
C     SO THE NON-ANSI CONSTRUCT REAL*4 IS USED IN THIS CODE.
C     
      SUBROUTINE CPUTIM(T)
      REAL T
      REAL*4 TARRAY(2),ETIME
      T=ETIME(TARRAY)
      T=TARRAY(1)
      RETURN
      END
C
C     CPUTIM RETURNS ELAPSED USER TIME, T, IN SECONDS.
C     NOTE T IS OF TYPE 'REAL'

C     ON THE ALLIANT, INTRINSIC FUNTION 'TIME' IS CALLED.
C     TIME RETURNS SYSTEM TIME IN SECONDS SINCE JAN. 1, 1970,
C     AND WE ONLY USE THE LEAST SIGNIFICANT 6 DIGITS.
C     
      SUBROUTINE ELAPSE(T)
      REAL T
      INTEGER TIME
      T=MOD(TIME(),1000000)
      RETURN
      END
 
      SUBROUTINE FUNTIM(TIM)
C
C     THIS SUBROUTINE IS USED BY THE RUNTIME LIBRARY FOR THE
C     INSTRUMENTED VERSIONS OF THE PERFECT BENCHMARKS.
C
      REAL TIM (3),T
      CALL CPUTIM(T) 
      TIM(1)=T
      CALL ELAPSE(T)
      TIM(2)=T
C     TIM(3) = ????
      RETURN
      END

