Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / CPU Usage

Author
Message
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 19th Jun 2008 22:03 Edited at: 19th Jun 2008 22:04


The above code runs at around 40-50% CPU usage on my computer Why is this? Are there any tricks to reducing this waste of resources (where a continuous loop is necessary)?
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 19th Jun 2008 22:08
Try making it do something.

If you can do any models for FW, reply to the FleetWars thread.

Click here!
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 19th Jun 2008 22:17
My point is, surely it shouldn't be using so much processing power since it is doing almost nothing
aersixb9
16
Years of Service
User Offline
Joined: 29th Nov 2007
Location:
Posted: 19th Jun 2008 22:18
It's not doing nothing, it's looping as fast as it can and doing a conditional...

http://overspace.panddpictures.net
SourceForge: OverSpace
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 19th Jun 2008 22:31
The poor little guy tries too hard for its own good! Sorry for wasting your time with such a stupid question
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 19th Jun 2008 23:27 Edited at: 19th Jun 2008 23:27
I'm far from a great source of advice, but I think this timer class that I wrote once might help:



Of course, it also could be a complete waste of a post. Who knows.
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 19th Jun 2008 23:29
You know what, Mahoney? Thank you. Now I don't have to work out something for DarkStar for reloading and stuff like that.

If you can do any models for FW, reply to the FleetWars thread.

Click here!
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 19th Jun 2008 23:32
Your welcome? Wow, I was helpful for once.
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 19th Jun 2008 23:35
Also, make sure to #include <time.h>

Login to post a reply

Server time is: 2024-11-20 13:27:44
Your offset time is: 2024-11-20 13:27:44