Solved
Unidata 7.2 on AIX - Is there a way to do a millisecond sleep?
I have a need to do a 400ms sleep in a Unidata program. Is it possible?
Best answer by Steve Wingfield
I have a need to do a 400ms sleep in a Unidata program. Is it possible?
You could also leverage openSocket's millisecond timeout parameter, and go to a non-listening address:
DESIRED.SLEEP.TIME = 400 ;* in milliseconds
* openSocket tries 3 times, so scale down
* the desired sleep time by 1/3...
SOCKET.TIMEOUT = INT(DESIRED.SLEEP.TIME/3)
NON.LISTENING.IP = "192.0.2.0" ; * see https://tools.ietf.org/html/rfc5737
NON.LISTENING.PORT = 0
BLOCKING = 1
START.TIME = SYSTEM(12)
RET = openSocket(NON.LISTENING.IP, NON.LISTENING.PORT, BLOCKING, SOCKET.TIMEOUT, OUT.HANDLE)
END.TIME = SYSTEM(12)
PRINT "Elapsed Time: " : (END.TIME - START.TIME)
Sign up
Already have an account? Login
Welcome to the Rocket Forum!
Please log in or register:
Employee Login | Registration Member Login | RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.
