"G8 | 8======D" <li*******@gmail.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
Does anybody know the timing accuracy of VB.Net.
I remember that in VB.60, one can only trigger an event with time
accuracy <10ms.
How about VB.Net? Was this improved?
I am making a project for instrument controlling. The shutter should
open for 10~100ms and I am wondering if it's possible or not to do this
with VB.Net
fwiw, that VB6 limitation is caused more by the OS than the language. You
can never rely on the accuracy of a timer >event<. They're extremely low
priority on the list of things an OS has to do to keep things running
smoothly. Just about anything can prevent or delay the event. On a PC that's
running >only your app<, you can get events near 1ms intervals using API
based timers in VB6. Probably similar with dotNet apps.
I always cache the current time (most of the time, from one of the OSs
timers) and calculate how long it's been since the last timer event and usethat< information to determine whether or not a specific period of time has
elapsed.
So, imo, get that timer firing as fast as it can and calculate elapsed times
instead of relying on an event. Once you've determined the accuracy you can
actually depend on, you can slow the "ticks" down a bit to avoid flooding
the timer event code.
Side note: My entire job revolves around instrument control <g>
(
http://www.tamsci.com/products/products.html). Everything we sell runs on a
combination of C and VB5/6.
--
Ken Halter - MS-MVP-VB (visiting from VB6 world) -
http://www.vbsight.com
Please keep all discussions in the groups..