Java-Gaming.org
Java4K winners:
[
by our judges
|
by the community
]
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members
News
: Read the
Java Gaming Resources
, or peek at
the official Java tutorials
Home
Help
Search
Login
Register
Java-Gaming.org
>
Game Development
>
Newbie & Debugging Questions
>
100% cpu usage
Pages: [
1
]
Print
100% cpu usage
(Read 935 times)
0 Members and 2 Guests are viewing this topic.
mc_java
JGO n00b
Posts: 5
Java games rock!
100% cpu usage
«
on:
2004-12-25 18:37:24
»
hello, just wanted to know if bad coding will result in high cpu usage.
my game so far generates 100% cpu usage and all i have is a 20 by 20 map in a jscrollPane. it lags whenever it has to do sth...
so is it my code thats causing this or is it sth else?
darkprophet
JGO Neuromancer
Posts: 1171
Go Go Gadget Arms
Re: 100% cpu usage
«
Reply #1 on:
2004-12-26 07:27:43
»
depends on what ur doing..
are you calling Thread.yeild(), Thread.sleep(x), or just an infinite loop?
If ur calling Thread.sleep(x), then it must be something else, If your doing a straight loop, with no timing, then its the programs fault.
If your doing Thread.yeild(), what happens is that your thread moves away from the cpu, giving another thread a chance to come and do its own stuff, and when thats finished, your thread comes back. So in essence, Thread.yeild() is the best way to go. 100% CPU usage is not a bad thing at all!
Friends don't let friends make MMORPGs.
Blog
|
Volatile-Engine
Pages: [
1
]
Print
Jump to:
Please select a destination:
-----------------------------
Games Center
-----------------------------
=> Featured Games
=> Showcase
=> Contests
===> LWJGL16k - 2011
===> 4K Game Competition - 2012
===> JGO Comp Petite
===> Finished Contests
=====> 4K Game Competition - 2011
=====> 4K Game Competition - 2010
=====> 4K Game Competition - 2009
=====> 4K Game Competition - 2008
=====> 4K Game Competition - 2007
=====> 4K Game Competition - 2006
=====> 4K Game Competition - 2005
=====> Tiny Game 2010
=====> JGO Comp 2009
=====> 16K LWJGL Competition - 2005
=====> Java Technology Game Development Contest - 2004
-----------------------------
Discussions
-----------------------------
=> General Discussions
===> Suggestions
=> Business and Project Discussions
===> Jobs and Resumes
===> Community & Volunteer Projects
=> Miscellaneous Topics
-----------------------------
Game Development
-----------------------------
=> Newbie & Debugging Questions
=> Articles & tutorials
=> Game Play & Game Design
=> Game Mechanics
===> Artificial Intelligence
=> Networking & Multiplayer
=> Performance Tuning
=> Shared Code
-----------------------------
Java Game APIs & Engines
-----------------------------
=> Engines, Libraries and Tools
===> Java 3D
===> JInput
===> jMonkeyEngine
===> Xith3D Forums
===> Tools Discussion
=> Java 2D
===> JavaFX
=> OpenGL Development
===> JOGL Development
===> LWJGL Development
=> Java Sound & OpenAL
===> JOAL Development
=> Java on Mobile Devices
===> Android
===> J2ME
Loading...