Java语言倒计时程序独秒怎么编写比较好,要求有完整的代码才能采纳

Java语言倒计时程序独秒怎么编写比较好,要求有完整的代码才能采纳

//使用定时循环,这里使用的是JDK1.8

 public static void main(String[] args) {
    ScheduledExecutorService mScheduledExecutorService = new ScheduledThreadPoolExecutor(4);
    mScheduledExecutorService.scheduleAtFixedRate(() -> {
        System.out.println(Instant.now().getEpochSecond());
    }, 0, 1, TimeUnit.SECONDS);
}

//输入的值是秒级时间戳,根据你自己的需要再具体转格式