× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Aaron,

If you don't need to go down to the microsecond, sleep() works just fine for whole seconds.

 -mark

At 12/12/06 03:01 PM, you wrote:
Hi All,

I am trying to get my program to delay for a certain amount of microseconds
before continuing execution by using the usleep C function.  The only
problem is that it isn't delaying for the amount of time I specify!

Here is what I have in a RPGILE service program module:

           temp = 'Beg:' + %char(%timestamp()) + ' ms=' + %char(Cfg.Sleep);
           dsply temp;
           rc = usleep(Cfg.Sleep);
           temp = 'rc=' + %char(rc);
           dsply temp;
           temp = 'End:' + %char(%timestamp());
           dsply temp;

Results in joblog:

DSPLY  Beg:2006-12-12-13.02.32.931000 ms=300000
DSPLY  rc=0
DSPLY  End:2006-12-12-13.02.33.811000


If my calcs are correct, and based on the following url, 300000 microseconds
should equal 3 seconds which is NOT what my joblog is conveying.
http://www.sengpielaudio.com/calculator-millisecond.htm

Any ideas?

Aaron Bartell
http://mowyourlawn.com



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.