如何在运行一次60秒后睡眠以下线程5分钟

时间:2016-04-18 13:52:29

标签: java multithreading

  ScheduledExecutorService blinkRate = Executors.newSingleThreadScheduledExecutor();
        blinkRate.scheduleAtFixedRate(new Runnable() {
            @Override
            public void run() {
               if(blink_count < 10 && blink_count > 0){
                  //sleep the thread for 10 minutes
               } 
            }
        }, 0, 20, TimeUnit.SECONDS);

0 个答案:

没有答案