Java 循环处理数据并每 10 次暂停 1 秒
for (int i = 0; i < instLists.size(); i++) { InstList instList = instLists.get(i); // Your code here
if ((i + 1) % 10 == 0) {
try {
Thread.sleep(1000); // Pause for 1 second
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
原文地址: https://www.cveoy.top/t/topic/bdSd 著作权归作者所有。请勿转载和采集!