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



I tried what you said (_WAIT_MPL_SET)
Results are pretty similar:
Delay = 10 ms, waittime: 18.480 ms
Delay = 20 ms, waittime: 38.960 ms
Delay = 30 ms, waittime: 59.432 ms
Delay = 40 ms, waittime: 52.360 ms
Delay = 50 ms, waittime: 69.720 ms
Delay = 60 ms, waittime: 89.440 ms
Delay = 70 ms, waittime: 69.824 ms
Delay = 80 ms, waittime: 91.824 ms
Delay = 90 ms, waittime: 119.128 ms

Actually I do not expect that waittime is somewhat precise in milliseconds range - at least I see it isn't.
If you tell her to wait for a minute, you probably do not care about +/- 20ms!

But is there something that works reasonably in a milliseconds range?


-----Original Message-----
From: c400-l-bounces@xxxxxxxxxxxx [mailto:c400-l-bounces@xxxxxxxxxxxx] On Behalf Of Buck Calabro
Sent: Tuesday, April 15, 2014 8:21 PM
To: c400-l@xxxxxxxxxxxx
Subject: Re: [C400-L] waittime function precision

On 4/15/2014 7:04 AM, Jevgeni Astanovski wrote:

I've used waittime function for pretty long time in cases, where I needed to have a delay in my program.
But recently a question appeared - how precise it is and are there any alternatives that allow to make delays for less than 1/100 of a second.

I think this is expected behaviour for waittime(). I always understood waittime to guarantee a minimum delay, not to guarantee a precise delay.

_WAIT_NORMAL sets all bits off, so
Access state control = no explicit transfer of PAG
MPL control = remove thread from multiprogramming level
Async signals = Not allowed

Judging from this, it seems like there would be some time the processor spends swapping the thread into and out of the MPL. It would be interesting to try this on a dedicated machine, and also with _WAIT_MPL_SET rather than _WAIT_NORMAL.

http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=%2Frzatk%2FWAITTIME.htm

--buck
--
This is the Bare Metal Programming IBM i (AS/400 and iSeries) (C400-L) mailing list To post a message email: C400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at http://archive.midrange.com/c400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.