Results 1 to 7 of 7

Thread: QueryPerformanceCounter (CPU Usage)

Threaded View

  1. #5
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: QueryPerformanceCounter (CPU Usage)

    This code here uses Sleep if necessary and makes sure the code is executed the required amount in seconds. You can actually make the code execute more often. It isn't perfectly accurate (thanks to Sleep), but a human can't possibly notice the millisecond differences. I can't really see anyone using this for thousands of iterations/second.

    Attached a sample project which has one iteration (0) doing nothing for 1000 times/second, and another (1) for updating Form1.Caption every one seconds.


    So basically this is just a very advanced version of the sample code by CVMichael (using QueryPerformanceCounter instead and controls the timings).
    Attached Files Attached Files
    Last edited by Merri; Dec 23rd, 2006 at 06:40 AM.

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