The title says it all.
Thread.sleep(500) // sleep 500 milliseconds.
public Wombat(){
while(dead == false){
Thread.sleep(5000);
setImage("wombat2");
Thread.sleep(1000);
setImage("wombat");
}counter++;
if (counter == 4)
{
counter = 0;
// do something
}counter = (counter + 1) % 4;
if (counter == 0) { //* do something */ }while(x == true){
counter = (counter + 1) % 4;
if (counter == 0) {
counter = (counter + 1) % 4;
if (counter == 0) {something new}}}counter = counter + 1; while (counter >= 4) counter = counter - 4;