473,396 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

timing accuracy of VB.Net

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

Jan 25 '06 #1
2 2090
Hi,

The timer in the component tab is more accurate than the
system.windows.forms.timer. Read this article about the types of timers.

http://msdn.microsoft.com/msdnmag/is...T/default.aspx

Ken
----------------
"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

Jan 25 '06 #2
"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..
Jan 25 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Michael Lang | last post by:
You'd think that the advantage to extra decimal places in a data type is better accuracy. Well think again. Look at this method and test results: ...
15
by: dkultasev | last post by:
I mean, when I am trying to get result of 1/3 (or smf) it returns 0.33333333334 or something. I understand that result can not be 100% right, but it is it possibly to get more accuracy ?...
5
by: Pushkar Pradhan | last post by:
I've decided to use clock() to time my routines, my code is like this: clk1 = clock(); while (n != 1000000) { mm_2r2c_2r2c_bc(&a, &b, &c); n++; } clk2 = clock(); t2 = time(NULL);...
6
by: Thomas Lumley | last post by:
What does the standard guarantee about the accuracy of eg the trigonometric functions? There is obviously an implementation-dependent upper bound on the accuracy, since the answer is stored in a...
1
by: coop | last post by:
I'm trying to port a high-accuracy reaction-time gathering application from a RTLinux C implementation into a web-avaliable implementation. We're obviously expecting to lose some accuracy and...
2
by: Steven D'Aprano | last post by:
The timeit module is ideal for measuring small code snippets; I want to measure large function objects. Because the timeit module takes the code snippet argument as a string, it is quite handy...
1
by: Gary Coutts | last post by:
Hi, I need to find out the execution time of some methods. Can anyone tell what the best resolution I can except when timing routine. I really need sub millisecond accuracy. Cheers
4
by: DR | last post by:
What is the best possible resolution that C# timing tests can get? milliseconds? nanoseconds?
5
by: Sensei | last post by:
Hi again! I am trying to figure a simple example of a program that shows the accuracy differences between float and double types. In particular I'm searching for an operation that works on...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.