It's not a secret anymore!*
The moose likes Performance and the fly likes reduce cpu usage in thread Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Performance
Reply locked New topic
Author

reduce cpu usage in thread

Aayush Singhal
Ranch Hand

Joined: Jan 06, 2011
Posts: 47
i am using a thread to update a moving ticker on the screen like the bootom of a news channel.
it's something like this :
while(true)
{
Thread.sleep(10);
x++;
repaint();
}

The trouble is that it is having high CPU usage about 25% due to which my other applications are having trouble.

What should i do to reduce the CPU usage?

Edit : please close it. it is being discussed in the Swings sub-forum. Thanks
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6657
    
    5

Please do not cross post

http://www.coderanch.com/t/522630/GUI/java/Reduce-CPU-usage-thread


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: reduce cpu usage in thread
 
Similar Threads
Need to reduce the CPU usage when thread is running.
B&S Data => Lock-waiting giveup CPU
CPU usage of JTable
Reduce CPU usage for a thread
Performance Tuning in Liferay