我需要安排将来要完成的工作。我能做到这一点在两个方面:TimerTask和Executors.newScheduledThreadPool之间的区别(1)
创建
TimerTask
和执行timer.schedule(...);
使用
Executors.newScheduledThreadPool(1)
:ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1); ScheduledFuture <?> scheduleHandle = scheduler.schedule(pushExternalRunnable, runScheduleDate.getTime() - now.getTime(), TimeUnit.MILLISECONDS);
是什么调度的这2种方式的区别在未来工作?
可能重复的[Java Timer vs ExecutorService?](http://stackoverflow.com/questions/409932/java-timer-vs-executorservice) – marcolopes 2016-03-04 22:06:49