Win a copy of Functional Reactive Programming this week in the Other Languages forum!
    Bookmark Topic Watch Topic
  • New Topic

reduce cpu usage in thread

 
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
 
    Bookmark Topic Watch Topic
  • New Topic