Thread.sleep takes lot of CPU time!
- From: "Raga" <raaga.t@xxxxxxxxx>
- Date: 17 Jul 2006 06:49:08 -0700
Hi,
I have the run method like this:
.....
.....
public void run()
{
....
while(true)
{
....
//some set of operations
.....
Thread.sleep(5*1000*60);
}
In the above code, the sleep operation seems to take a lot of CPU time
though ideally sleep is like a no-op mode, meaning since no operation
is done when a thread sleeps, it should not use any/minimal CPU time.
But it seems to take over 30% of CPU time!
Any ideas on why such a weird thing's happening?
In fact, in one more similar method also, sleep is taking similar CPU
time.
.
- Follow-Ups:
- Re: Thread.sleep takes lot of CPU time!
- From: pranshu
- Re: Thread.sleep takes lot of CPU time!
- From: Philipp Leitner
- Re: Thread.sleep takes lot of CPU time!
- Prev by Date: Re: Which Swing Component is this?
- Next by Date: Convert eclipse project into Netbeans
- Previous by thread: Simple question: bounded generics
- Next by thread: Re: Thread.sleep takes lot of CPU time!
- Index(es):
Relevant Pages
|