for (Object object : jsonArray) {
Thread.currentThread().sleep(1000);
list.add(((JSONObject)object).get("Name"));
}
此處的停頓 適用於邏輯代碼和循環 1000的單位爲毫秒
停頓後提示一個未處理的異常
此時需要異常處理
//拋出異常
throws InterruptedException
//或者try catch操作
try {
Thread.currentThread().sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}