u013140391
纯洁的LELE
2017-09-12 11:11

Thread.sleep问题求解

  • java
  • quartz

用的quartz定时任务

代码:
log.info("afternoon task start...");
long delay = random.nextInt(3600) * 1000;
log.info("sleep " + delay + " ms");
Thread.sleep(delay);
log.info("afternoon send start...");

日志:
[INFO ] 2017-09-12 18:00:00,456 16896832 DefaultQuartzScheduler_Worker-1 core.AfternoonJob core.AfternoonJob.send(AfternoonJob.java:20) afternoon task start...
[INFO ] 2017-09-12 18:00:00,457 16896833 DefaultQuartzScheduler_Worker-1 core.AfternoonJob core.AfternoonJob.send(AfternoonJob.java:23) sleep 2655000 ms

然后就没有然后了,按理来说18:44应该要执行的

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答

为你推荐

换一换