Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Keeping the CPU usage down  (Read 1643 times)
harikumar001
Customers
Community Member
*****
Posts: 65


« on: October 14, 2010, 10:21:44 AM »

Hey guys,

Wishing you all a good day.

Very close to finishing my application. I have been closely monitoring some 3D applications on CPU usage and I find that they just use under 30% of CPU and use a mere 6-7% when idle.

On the other hand, I run my application and even when it is idle it is using 60-70% of the CPU. I believe, the while loop has to keep running for the application to render stuff, means it consumes CPU resource. But it keeps me wondering, how these other applications can keep the CPU usage so low. Don they render every frame? Any pointers?

Regards
Logged
asia
Customers
Community Member
*****
Posts: 183


« Reply #1 on: October 14, 2010, 12:21:19 PM »

It could be related on how you set the screen redraw, or, in other words, the game loop.
Did you redraw as fast as you can (max FPS)?
Did you draw every 1/20 of a second?
Did you set TV.SetVSync True?
Did you paint when a wondow paint event is fired?
Did you consider to look at the profiler (TV.EnableProfiler True)?
Have a look to (search in this forum)

Tom Miller's

in this forum. You can have an idea on how can be built a game loop....
Ciao
Logged

Fabio Musmeci
ENEA
CR Casaccia
Via Anguillarese 301
00060 Rome
Italy
musmeci@enea.it
+39 3333934898
Learning to live better on a smaller footprint..
AriusEso
Customers
Community Member
*****
Posts: 940

Esoteric


« Reply #2 on: October 15, 2010, 07:47:28 AM »

Sleep the CPU in every iteration for a millisecond or so. This is how it usually is done. Personally I don't bother, but this is why you see the dip in the cycle. They sleep it. As for "idle", not sure what you mean by this. If you mean unfocused or minimized, you can check the handle for this and then simply stop processing.
Logged

-...-

Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks