Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Execute Block of code using core java  RSS feed

 
aresh babu
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

i have a requirement that i need to execute a block of code for every 30minutes using core java only.Please let me know how can i do it?

Thanks in advance.

Regards
Aresh
 
Henry Wong
author
Sheriff
Posts: 23275
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

For one task.... try java.util.Timer

For many tasks, and more complex requirements... try java.util.concurrent.ScheduledThreadPoolExecutor


Henry
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!