• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

timer for a task

 
mark smith
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

i have program who run 24h/24h...

i would like to start a task (method) at 5:00 and stop this task at 18:00...
is there a way to do it?

thanks
 
Campbell Ritchie
Sheriff
Pie
Posts: 49827
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lots of ways; doing a search of these fora will reveal other threads about the same subject.
Try a java.util.Timer or a javax.swing.Timer, or repeatedly querying Calender objects for the time, or anacron or cron, or Windows task scheduler. As I said, a search will reveal many possible solutions.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic