Win a copy of Murach's Python Programming this week in the Jython/Python forum!
    Bookmark Topic Watch Topic
  • New Topic

reduce cpu usage in thread  RSS feed

 
Aayush Singhal
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
 
It is sorta covered in the JavaRanch Style Guide.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!