R
Raga
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.
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.