I’d think many of you played the game Candy Crush, which gives you a maximum of five lives and takes away one every time you fail to solve the puzzle. Of the several ways you can replenish your lives, one option is to just wait for “x” number of minutes and the game gives you a life each time that wait time is up. That behavior is basically what I’m trying to adapt in my game.
How would I go about keeping track of the time between the moment when the user used up his/her lives and when the time requirement (in minutes) is satisfied? And, of course, this timer should still be running in the background even when the player completely closed the game (i.e., no persisting session in the device’s background).