Link to home
Start Free TrialLog in
Avatar of senardji
senardji

asked on

marking time in vb

i want to mark time to as much precision
as possible.  how do i do it in vb?

thanks.
senardji
ASKER CERTIFIED SOLUTION
Avatar of gafftech
gafftech

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mark2150
mark2150

You asked this same Q twice.

You can't measure time more precisely than the 18.2hz (55ms) timer tick without special hardware.

M
You asked this same Q twice.

You can't measure time more precisely than the 18.2hz (55ms) timer tick without special hardware.

M
Avatar of Brendt Hess
The 18.2hz limit is not a problem anymore.  The system has more accurate timing than that available.

Here's a link to some examples of 1ms precision timers:

http://www.thescarms.com/vbasic/Timer.htm
The 18.2hz limit is not a problem anymore.  The system has more accurate timing than that available.

Here's a link to some examples of 1ms precision timers:

http://www.thescarms.com/vbasic/Timer.htm
use TickCount API....it's an easy way to get the time information..and more accurate than timer control...but not too difficult to declare
Avatar of senardji

ASKER

thanks all!
bhess1,

You should have read the 'fine print'... from the page you cite:

Code based timers are still subject to the operating system's load and preemptive multitasking nature.  For best results, close all unnecessary applications.

Guess what? You simply cannot *guarentee* tight timing with software based timers. You *have* to use hardware as a timing reference if you need *ACCURATE, CONSISTENT, RELIABLE* timing! And the PC simply doesn't have that. If you need a steady "heartbeat" timer that doesn't vary, doesn't jitter, doesn't slop, the only thing you can use on a standard PC is the 18.2Hz time of day clock. If you need tighter times than that you'll have to add hardware.

M