How can you program something to wait a specific amount of time before it does another task?


1 2 3 4 5 6 7 8 9 10 | Public void method() { Int i= 0 ; While(i< 10 ){ i++; } if (i= 10 ){ Method2(); } } |
1 2 3 4 5 6 7 8 9 10 | Public void method() { Int i= 0 ; While(i< 10 ){ i++; } if (i= 10 ){ Method2(); } } |
1 2 3 4 5 6 7 8 9 | int i= 0 public void timer( int time) { i++; if (i==time) Method2(); if (i==time+ 1 ) i= 0 ; } |