Loop according to time

  • Thread starter TheTravellingSalesman
  • Start date
T

TheTravellingSalesman

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
?
 
A

Andrew Thompson

TheTravellingSalesman said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top