12-04-2004 12:47 AM
12-04-2004
01:14 AM
- last edited on
11-11-2025
02:33 PM
by
Content Cleaner
The problem is the fact that even milliseconds are pretty meaningless on a OS like windows. Such a precision cannot be guaranteed in software.
What exactly are you trying to achieve? Typically, such timings only make sense in hardware control and in this case you can use the board timers. Have a look at e.g. the Counter/Timer boards.
Of course, LabVIEW RT has a 1MHz resolution in software.
12-04-2004 12:30 PM
Of course, LabVIEW RT has a 1MHz resolution in software.
Look, the idea of millisecond sleeps goes back a good thirty years or more, to the era when state of the art computers ran at about 1MHz. Nowadays, computers are several THOUSAND times faster than that, so it seems to me that there shouldn't be any reason why sleep times couldn't be about (1/1000)th of what they were back in the day.
At the other end of the spectrum, LabVIEW has a 128-bit Timestamp data type that has at least 64-bits worth of precision for the fractional side of things, so someone at NI realized early on that computers were destined to become faster over the years.
12-04-2004 01:07 PM
12-04-2004 04:28 PM
12-04-2004 06:19 PM
12-05-2004
12:44 AM
- last edited on
11-11-2025
02:33 PM
by
Content Cleaner
@tarheel_hax0r wrote:
Here's another example of a need for a very short sleep interval: When you stress test an application, it helps to overwhelm it by a factor of a thousand, or a million: Loops that might normally be run ten times get run a million times; arrays that might have ten elements get expanded to a million elements; sleep times of (1/10)th of a second are sped up to a mere (1/1000000)th of a second.
OOPS - can't do that last one: If your App has sleep times, there's no way that it can ever be sped up faster than that (1/1000)th of a second minimum.
Don't forget that you can wire a zero to the wait function. This is NOT a NO-OP, but causes the execution system to switch to a different task. Maybe that's all you need. This is especially useful in parallel loops that need to run fast but should not block each other.
You can also put your 1ms wait into a case structure which is active only every n'th iteration of the loop.
Also, have a look at Application note 114 [broken link removed], for example.
12-05-2004 01:54 PM
12-05-2004 04:07 PM
@tarheel_hax0r wrote:
Do you know of any authoritative documentation that says that setting the U32 value to zero will do nothing more than cause the thread to relinquish the CPU?
Thanks!
12-06-2004 08:39 AM