Make the thread sleep
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | dt | Time to sleep in seconds |
subroutine wait(dt)
!! Make the thread sleep
real(wp),intent(in)::dt
!! Time to sleep in seconds
integer(c_int)::usec
integer(c_int)::ret
interface
function doSleep(usec) result(e) bind(C,name='usleep')
use iso_c_binding
integer(c_int),value::usec
integer(c_int)::e
end function doSleep
end interface
usec = nint(dt*1.0E6)
ret = doSleep(usec)
end subroutine wait