      module stopwatch

      character(len=8)   ::    date1,date2
      character(len=10)  ::    time1,time2
      character(len=5)   ::    zone1,zone2
      integer, dimension(8) :: values1,values2
      public starttime, stoptime

      contains
! ---------------------------------------------------- ! 
      subroutine starttime
! ---------------------------------------------------- !
      call date_and_time(date1,time1,zone1,values1)
      end subroutine 

! ---------------------------------------------------- !
      subroutine stoptime
! ---------------------------------------------------- !
      real(8) :: earliersecs,rlatersecs,timelasped

      call date_and_time(date2,time2,zone2,values2)
      earliersecs=dble(values1(3)*86400+values1(5)*3600+values1(6)*&
     &            60+values1(7))+values1(8)*0.001
      rlatersecs=dble(values2(3)*86400+values2(5)*3600+values2(6)*&
     &            60+values2(7))+values2(8)*0.001      
      timelasped=rlatersecs-earliersecs
      write(1,'(1x,a11,f10.3,a5)') 'elaps time=',timelasped,' secs'
      write(6,'(1x,a11,f10.3,a5)') 'elaps time=',timelasped,' secs'
      end subroutine
! ---------------------------------------------------- !
 
      end module
