1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
public class timer {
public static void compteur() {
try{
//Code suceptible d'echouer
int t = 0;
System.out.print(" ");
while(t < 5) {
System.out.print("\b/");
Thread.sleep(500);
System.out.print("\b-");
Thread.sleep(500);
System.out.print("\b\\");
Thread.sleep(500);
System.out.print("\b|");
Thread.sleep(500);
t ++;
}
System.out.print("\b*");
}
catch(InterruptedException exeption){
//Code a effectuer en cas d'exception
System.out.print(" aie planté!");
}
}
} |