Click to See Complete Forum and Search --> : measure acuracy 1/1000 sec from fixpoint to keystroke


Thomas R.
March 12th, 1999, 01:18 PM
Hi

i need a routine that measure the time from a fixpoint

to the hit a key on the keyboard with accuracy of 1/1000 second.

I work with macromedia.Do u know an xtra that do the job?

Or are u able to do the job in MS-Visualbasic or MS-Visual c++

or in kind of an dll what ever? Please peply.

Thomas

Chris Eastwood
March 15th, 1999, 03:24 AM
Hi



You might want to check out the High Performance Timer Objects from the CCRP team.


Take a look at http://www.mvps.org/ccrp


Regards


Chris Eastwood


CodeGuru - the website for developers

http://www.codeguru.com/vb

Harry Gilbert
July 21st, 1999, 05:52 PM
The best way I have found is by using the QueryPerformanceFrequency and QueryPerformanceCounter API Calls. They access very low-level timers which give readings in the microsecond range. They take 8-byte integers, so pass a Currency. Example, how long a process takes:

Dim cFreq as Currency, cT1 as Currency, cT2 as Currency
QueryPerformanceFrequency cFreq ' need to get this only once
..
QueryPerformanceCounter cT1 ' get timestamp
..do something
QueryPerformanceCounter cT2 ' get 2nd timestamp
Label1 = format$((cT2-cT1)/Freq, "#.######") ' display in seconds




I use these all the time and they're the best I've found.