I am making an idle game that involves you placing things on tiles to earn money. How would I go about causing something to run for a certain amount of time, and run only once a second without pausing the whole program?


1 2 3 4 5 6 7 8 9 | // instance field private int timer; // in act method timer = (timer+ 1 )% 50 ; if (timer < 10 ) { < do something > } |