Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2008

Tip: Looking for answers? Try searching our database.

TimerTask drift away

Thread view: 
Mitschu - 28 Apr 2008 10:20 GMT
Hi
I use a TimerTask which is scheduled to run every minute at seconde 40
eg. 11:15:40 and next 11:16:40.
After a day the task is running appr. 4-5 secondes later. There are
about 10 different TimerTasks running.
Is there a way to come absolute punctual?

Thanks
Michael
Philipp - 28 Apr 2008 11:01 GMT
> Hi
> I use a TimerTask which is scheduled to run every minute at seconde 40
[quoted text clipped - 5 lines]
> Thanks
> Michael

Use Timer.scheduleAtFixedRate() instead of Timer.schedule().

HTH
Phil
Roedy Green - 28 Apr 2008 12:15 GMT
On Mon, 28 Apr 2008 02:20:48 -0700 (PDT), Mitschu
<michael.arnold@sisag.ch> wrote, quoted or indirectly quoted someone
who said :

>Is there a way to come absolute punctual?

You need to resynch your clock with an atomic clock timeserver
periodically.  If Windows is not doing it, try setclock at
http://mindprod.com/webstart/setclock.html
Signature


Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.