r_wait Subroutine

public subroutine r_wait(time)

Arguments

Type IntentOptional Attributes Name
real :: time

Called by

proc~~r_wait~~CalledByGraph proc~r_wait r_wait interface~wait wait interface~wait->proc~r_wait

Source Code

  subroutine r_wait(time)
    real                 :: time ! desired sleep interval [ms]
    integer,dimension(8) :: t    ! arguments for date_and_time
    integer              :: s1,s2,ms1,ms2 ! start and end times [ms]
    ! Get start time:
    call date_and_time(values=t)
    ms1=(t(5)*3600+t(6)*60+t(7))*1000+t(8)
    !
    do ! check time:
       call date_and_time(values=t)
       ms2=(t(5)*3600+t(6)*60+t(7))*1000+t(8)
       if(ms2-ms1>=time)exit
    enddo
    return
  end subroutine r_wait