01-29-2008 10:59 AM
01-29-2008 11:43 AM
01-29-2008 12:04 PM
Brian is correct. The behavior is expected. Here is the reason why...
Wait Until Next Millisecond Multiple (WUNMM) looks at the millisecond counter that is ticking away in the background. Assuming you have code that executes much quicker than 500 ms, the length of the first iteration is unpredictable. This is becasue the code looks at the millisecond timer and waits until the next multiple of your input. So, if the section of code with the WUNMM is entered when the millisecond timer is at 350 ms, it will only wait 150 ms, which is waiting "until the next multiple of 500 ms occurs on the millisecond timer". Each iteration after that should then take 500 ms, again assuming that code runs quicker than 500 ms.
If you want your section of code to take 500 ms for the first and all other iterations, use WAIT not the WUNMM. Wait is the one with the "wristwatch" icon, not the "metronome" icon.
01-29-2008 12:05 PM
01-29-2008 12:21 PM
Adding to what Brian and Ed said.
I seldom use the WUNMM.
I think of it as a random delay generator. ![]()
The only thing you can guarentee about its operation in an app is that you use two of them and they are NOT set for prime number delays, they are quite effective in getting multiple threads to fight for the CPU at the same time. ![]()
Ben
01-29-2008 12:34 PM
01-29-2008 12:57 PM
01-29-2008 02:00 PM - edited 01-29-2008 02:02 PM
01-29-2008 02:03 PM
01-29-2008 02:04 PM