Loops per second of thread suddenly drops

Discussion in 'MFC' started by GrayFox, Mar 31, 2010.

  1. GrayFox

    GrayFox New Member

    Joined:
    Mar 31, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    I'm writing a program that copies the bitmap of the desktop (like a screenshot), calculates the average RGB value of the screen, and send it over USB.
    Everything is working and I manage to get 30+ loops per second, which is good enough.

    However, after some time (varying between ~20 sec and ~1 min 30 sec), and not doing anything else, the loops per second suddenly drop to about 10 loops per second, which is too slow for my purpose. This transition happens within a fraction of a second.

    When I watch the Task Manager, and don't see anything special happening. The CPU time for my process remains the same, the total CPU usage is quite stable, memory usage is stable as well.

    I've tried changing Thread priority and Process priority but nothing seems to work. I am at a loss here.

    Anyone has any ideas? I would greatly appreciate any suggestions, advice and thoughts.
     
  2. GrayFox

    GrayFox New Member

    Joined:
    Mar 31, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    I found the problem,
    it seems my processor, which is an Intel, slows down sometimes for some crazy reason.
    This happened at the exact same time my program slowed down as well...
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice