I want to run a task for 8 hours.
I am using ExecutorService executor = Executors.newFixedThreadPool(30).
and after submitting the task I am waiting for 8 hours .
This is the code I have used.
task1.get(8,TimeUnit.HOURS);
Problem is the code after above statement will be executed after 8 hours . I wanted the task to be executed for 8 hour but the statement after that should be printed immediately. Can somebody suggest some way.