07-06-2021 02:03 PM
A 1 ms wait and a 2 ms wait are the same for me. This is probably a limitation of the OS (Win 10) right? No way to do better?
07-06-2021 02:11 PM
@nanocyte wrote:
This is probably a limitation of the OS (Win 10) right?
That is correct. If you need more exact timing, you need to go to a Real Time OS where determinism is more important than a GUI or being a general use OS.
07-06-2021 03:00 PM
You could try the High Resolution Polling Wait VI and see if that's any better.
But in general yes, if you need exact timing, use a real-time OS.
07-07-2021 07:49 AM - edited 07-07-2021 07:51 AM
07-07-2021 08:28 AM - edited 07-07-2021 08:29 AM
Just comment to clear up a little confusion:
"High Resolution Relative Seconds" doesn't help - at least not for me.
"High Resolution Polling Wait" did the trick. Well, at least much closer than the original vi 😃
thois - brain malfunction when you repeated???
07-07-2021 12:48 PM
@thols wrote:
(Edit: why didn't I see the previous reply? Oh well, to repeat: )
You are measuring the wait time with low resolution. Measure using the High Resolution Relative Seconds and see what you get.
He's measuring the time to do 100 sequential waits, so the regular resolution timer should be fine- he should see 100 ms of time, then 200, 300, etc.
07-08-2021 06:27 AM
@nanocyte wrote:
A 1 ms wait and a 2 ms wait are the same for me. This is probably a limitation of the OS (Win 10) right? No way to do better?
Nope, can't do better with a normal wait. Why would you need it to? You can use a High Resolution polling wait, or e.g. set up a AI sampling and read 1 sample at a time as clock or something more exotic...
(I think you can hack the registry to change some windows clocks and timings, but it's not worth it)
07-08-2021 07:22 AM
Note that 0 ms is special.
In your test it doesn't seem to do anything, but it does switch thread (or clump?). If there are no other threads, it won't effectively 'wait', but if there are other threads it might actually result something not 0.
Waiting 0 ms is not the same as putting the wait in a case and skipping it completelly.
07-08-2021 10:38 AM
Some interesting information on the subject.
https://randomascii.wordpress.com/2020/10/04/windows-timer-resolution-the-great-rule-change/
07-08-2021 11:22 AM
wiebe@CARYA wrote:
Note that 0 ms is special.
In your test it doesn't seem to do anything, but it does switch thread (or clump?). If there are no other threads, it won't effectively 'wait', but if there are other threads it might actually result something not 0.
Waiting 0 ms is not the same as putting the wait in a case and skipping it completelly.
Can you point to documentation that describes this? Is it Windows specific? My intent was to have a small wait so as not to starve other threads but 2 ms was too long so a 0 ms wait might be just what I'm looking for.