How to call a thread to run on specific time in java?

前端 未结 3 1880
天命终不由人
天命终不由人 2021-02-05 18:54

I want o make threads execute at specific exact times (for example at: 2012-07-11 13:12:24 and 2012-07-11 15:23:45)

I checked ScheduledExecutorService, but

3条回答
  •  醉酒成梦
    2021-02-05 19:10

    Have you looked at CountDownLatch from the java.util.concurrent package? It provides a count down then triggers the thread(s) to run. I never needed to use it myself, but have seen it in use a couple times.

提交回复
热议问题