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
Post a Comment