for(int i=1; i<=10000; i++){ /////////////////////////// if(i%500==0){ try{Thread.sleep(5000);}catch(InterruptedException ex){} } ///////////////////}