Wanted: VB3 Timer with millisecond accuracy. 
Author Message
 Wanted: VB3 Timer with millisecond accuracy.

Can someone point me in the right direction for a routine or vbx that can
allow me to time with millisecond accuracy?  I have C routines that won't
go into a DLL nicely.  Too many GPF's.

send to mail box please,

will be very grateful for help!



Tue, 22 Sep 1998 03:00:00 GMT  
 Wanted: VB3 Timer with millisecond accuracy.

Quote:

>Can someone point me in the right direction for a routine or vbx that can
>allow me to time with millisecond accuracy?

If you want really high-resolution timing (and you have a Pentium) you can
 use the semi-undocumented RDTSC instruction to get an 8-byte count that
increments at the processor's internal clock rate.  For example, on a P100 the
count is in increments of 10 ns.  You need a DLL to execute the instruction,
but it's very simple.  Here's the procedure I use, in 16-bit Borland Pascal:

procedure RDTSC(var t:Comp); export;  {Comp is the same as VB Currency }
begin
 asm
  DB    $0F,$31         {RDTSC}

  LES   BX,t            {Address of 8-byte area}
  DB    $66             {Make next instruction 32-bit}
  MOV   ES:[BX],AX      {Store EAX}
  DB    $66             {Make next instruction 32-bit}
  MOV   ES:[BX+4],DX    {Store EDX}
 end
end;



Thu, 24 Sep 1998 04:00:00 GMT  
 Wanted: VB3 Timer with millisecond accuracy.

Quote:

> Can someone point me in the right direction for a routine or vbx that
> can allow me to time with millisecond accuracy?  

Someone else posted this a while back:

   '1ms resolution timer

   'declare
   Declare Function timeGetTime Lib "MMSYSTEM" () As Long

   'example
   oldtime& = timeGetTime()

    'code in here

   deltamillisec& = timeGetTime() - oldtime&

Bryan Miller



Sat, 26 Sep 1998 03:00:00 GMT  
 Wanted: VB3 Timer with millisecond accuracy.

Quote:


>> Can someone point me in the right direction for a routine or vbx that
>> can allow me to time with millisecond accuracy?  
>Someone else posted this a while back:
>   '1ms resolution timer

>   'declare
>   Declare Function timeGetTime Lib "MMSYSTEM" () As Long
>   'example
>   oldtime& = timeGetTime()

>    'code in here
>   deltamillisec& = timeGetTime() - oldtime&

If you're looking for a control that can cause events every
millisecond, the Waite Group's Visual Basic 4 How To book has one
called HiTime...

Quote:
>Bryan Miller

Scott Frazer                             Also the NetRep for
Network Administrator              Middle-earth: The Wizards
QualChoice of {*filter*}ia                      An ICE Card Game
www.QualChoiceVa.com                       www.IronCrown.com


Sun, 27 Sep 1998 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Millisecond accuracy for us vb programmers

2. Millisecond Accuracy Timing

3. Timer, accuracy in millisecs!

4. Timer Function Accuracy

5. vb timer accuracy ???

6. Timer Accuracy - Help !

7. Accuracy of Timers in VB5

8. Timer with high accuracy

9. Timer Accuracy

10. Timer accuracy??? -RFH ( Request for Help)

11. timer accuracy of mmsystem.dll

12. Accuracy of timers in VB?

 

 
Powered by phpBB® Forum Software