CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 1999
    Posts
    9

    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

  2. #2
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    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



  3. #3
    Join Date
    Jul 1999
    Posts
    11

    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.






Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured