@Override
public void run() {
for (int k = listStart; k < listStop; k++) {
System.out.println("执行业务操作……")
}
}
}
});
//以下是等线程池的全部线程执行结束后,会自动执行。
cachedThreadPool.shutdown();
while (true) {
if (cachedThreadPool.isTerminated()) {
long time = System.currentTimeMillis() - start;
System.out.println("["+Utils.getNowTime()+"]:" + "程序结束了,总耗时:" + time + " ms(毫秒)!\n");
break;
}
}