DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Java (http://www.daniweb.com/forums/forum9.html)
-   -   Problem in Timer (http://www.daniweb.com/forums/thread70565.html)

Venks Feb 21st, 2007 2:43 am
Problem in Timer
 
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

jwenting Feb 21st, 2007 1:13 pm
Re: Problem in Timer
 
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.


All times are GMT -4. The time now is 12:15 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC