× 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,

Not an answer as such, but:

http://www.think400.dk/adhoc_1.htm

"Finally, the documentation says the "usleep() function is included for its
historical usage.
The setitimer() function is preferred over this function."

So, it appears that both the code and documentation contain errors and we
should look at
setitimer() instead."




On 12/12/06, albartell <albartell@xxxxxxxxx> 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


--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.





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.