如果我有以下ExecutorService来执行任务,我怎样才能让它打印完成任务的时间?我应该在future.get()之后添加getCurrentTime()吗?
Future future = executorService.submit(new Callable(){
public Object call() throws Exception {
System.out.println("Asynchronous Callable");
return "I finished";
}
});
System.out.println("Status:" + future.get());