timing accuracy of VB.Net

G

G8 | 8======D

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
 
K

Ken Halter

G8 | 8======D said:
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 use
that< 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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Using VB.NET in the Real World 10
Better timing?? 2
UML tool for vb.net 2
monitor excel 1
simulating double click from within VB.NET 7
OnCtlColor() 2
Vb.net Mini Game 2
VB Code question 10

Top