@@ -0,0 +1,918 @@
+package com.hzh.corejava.concurrent.executor;%0A%0Aimport java.util.concurrent.Executors;%0Aimport java.util.concurrent.ScheduledExecutorService;%0Aimport java.util.concurrent.ScheduledFuture;%0A%0Aimport static java.util.concurrent.TimeUnit.SECONDS;%0A%0A/**%0A * Created by lenovo on 2017/2/17.%0A */%0Aclass BeeperControl %7B%0A    private final ScheduledExecutorService scheduler =%0A            Executors.newScheduledThreadPool(1);%0A%0A    public void beepForAnHour() %7B%0A        final Runnable beeper = () -%3E System.out.println(%22beep%22);%0A        final ScheduledFuture%3C?%3E beeperHandle =%0A                scheduler.scheduleAtFixedRate(beeper, 2, 2, SECONDS);%0A        scheduler.schedule(() -%3E %7B%0A            beeperHandle.cancel(true);%0A            scheduler.shutdown();%0A        %7D, 10, SECONDS);%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        BeeperControl beeperControl = new BeeperControl();%0A        beeperControl.beepForAnHour();%0A    %7D%0A%7D

Add ScheduledExecutorService example