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 / December 2007

Tip: Looking for answers? Try searching our database.

Loop according to time

Thread view: 
TheTravellingSalesman - 03 Dec 2007 07:19 GMT
I want to loop something according to time.

I.e. suppose if time right now is 12:00 AM

I want the loop to run every 1 minute till the time is 12:30 AM  for
instance.

Pseudo-code below

While(Time != 12:30 AM)                                    /// <-----
But I want this loop for run every minute
{  System.out.println("Time right now is " + time);
}

How would I code something like that in Java
?
Andrew Thompson - 03 Dec 2007 08:57 GMT
>I want to loop something according to time.

Are you planning to apply that loop to make a post to
this group every two minutes?  Please don't repost topics.

As to the need to 'loop on time', you might look to a
javax.swing.Timer.

Signature

Andrew Thompson
http://www.physci.org/

Lew - 03 Dec 2007 10:11 GMT
>> I want to loop something according to time.
>
> As to the need to 'loop on time', you might look to a
> javax.swing.Timer.

or java.util.Timer if it's not for a Swing app.

Signature

Lew



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



©2009 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.