Return to the RPG Tips
Delaying job for less than one second - (RPG prototype to the usleep function)
Here's an RPG prototype to the usleep function. *-- uSleep --- uSleep function (delay job for microseconds ) ------ * (999999 microseconds = just less than 1 second.) * unsigned int uSleep( unsigned int microseconds ); D uSleep PR 10I 0 ExtProc('usleep') D 10U 0 Value * Sleep for just less than one second C CallP uSleep(999999) Nathan.
** Additional Notes:
usleep's maximum value for the number of microseconds to sleep is
999,999 (almost 1 second).
If one specifies more than 999,999, usleep returns -1 (error) and errno is set to EINVAL (An invalid parameter was found).
For more information, see the usleep's function at
http://publib.boulder.ibm.com/iseries/v5r2/ic2924/index.htm?info/apis/usleep.htm
Mel Rothman
[report a broken link by clicking here]