ScheduledExecutorService threadPool = Executors.newScheduledThreadPool(5); Callable task1 = new Callable() { @Override public Object call() throws Exception { return null; } }; threadPool.schedule(task1,10,TimeUnit.SECONDS);
10分钟后执行该任务
ScheduledExecutorService threadPool = Executors.newScheduledThreadPool(5); Callable task1 = new Callable() { @Override public Object call() throws Exception { return null; } }; threadPool.schedule(task1,10,TimeUnit.SECONDS);
10分钟后执行该任务