标签:cut str ice thread dex read 类的方法 void err
package t1;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
public class TestThread17 {
public static void main(String[] args) {
ScheduledExecutorService es = Executors.newScheduledThreadPool(5);
// es.schedule(new Runnable() {
// @Override
// public void run() {
// System.out.println("开始作业");
// }
// }, 3, TimeUnit.SECONDS);
es.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
System.out.println("开始作业");
}
}, 3, 1, TimeUnit.SECONDS);
}
}
可以和Timer类的方法进行对比。
标签:cut str ice thread dex read 类的方法 void err
原文地址:https://www.cnblogs.com/dengw125792/p/12606375.html