ScheduledExecutorService 多线程问题
定义Scheduled线程池
public final static ScheduledExecutorService scheduledExecutor = Executors.newScheduledThreadPool(8);
....
调用方法,每隔30秒跑一下线程runnable
scheduledExecutor.scheduleWithFixedDelay(runnable, 30, 30 TimeUnit.SECONDS);
各位大神,问题是,为什么每隔30秒,跑两次runnable,而不是预计中的一次!输出日志大概是这样,注意时间
2017-11-28 17:27:20.430 INFO - runnable - running
2017-11-28 17:27:21.267 INFO - runnable - running
2017-11-28 17:27:51.460 INFO - runnable - running
2017-11-28 17:27:52.142 INFO - runnable - running
2017-11-28 17:28:22.769 INFO - runnable - running
2017-11-28 17:28:23.238 INFO - runnable - running
真心求教!