It's generally a bad idea to assume your app will be running in the background.
A better way to think about it IMO would be to set a variable to the current time in applicationDidEnterBackground:
and check the time interval to now in applicationWillBecomeActive:
:
- If the interval is bigger that your grace period, have the time backup to when the app was paused.
- If it is smaller, update it as if the app was never in the background.