i_wait Subroutine

public subroutine i_wait(time)

Arguments

Type IntentOptional Attributes Name
integer :: time

Called by

proc~~i_wait~~CalledByGraph proc~i_wait i_wait interface~wait wait interface~wait->proc~i_wait

Source Code

  subroutine i_wait(time)
    integer              :: 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 i_wait