measure acuracy 1/1000 sec from fixpoint to keystroke
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
Re: measure acuracy 1/1000 sec from fixpoint to keystroke
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
Re: measure acuracy 1/1000 sec from fixpoint to keystroke
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.