java - Thread to execute for specified amount of time. -


for every 30 seconds record store in sqlite db.

i want execute thread within 30 seconds post number of records in our server.

if thread exceed 30 seconds kill thread itself.

use timer follows:

timer t = new timer();   t.schedule(new timertask() {        @override       public void run() {                   //timer            system.out.println("done");           this.cancel();        }   }, 30000l); 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -