Problem in Timer

Reply

Join Date: Feb 2007
Posts: 35
Reputation: Venks is an unknown quantity at this point 
Solved Threads: 0
Venks's Avatar
Venks Venks is offline Offline
Light Poster

Problem in Timer

 
0
  #1
Feb 21st, 2007
Hi Friends..,

I have some problem in my timer thread.....

the actual problem is... if i start only my application means timer is working fine.....but if i start any other application in my desktop means...problem arising in timer....timer becomes slow in action...

and i have used Sleep range of 1000 in thread

thread.sleep(1000);

but whn i compare with my system time it becomes slow..in result
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,144
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Problem in Timer

 
0
  #2
Feb 21st, 2007
If your application gets less CPU cycles it might become more sluggish.
The sleep time is defined as the minimum time the thread will sleep, not an exact time.

If another application eats most of your CPU, the one you're monitoring may not get enough of a timeslice to hit that sleeping thread just after a second, causing it to lag behind.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC