So as I have learned today, if I put a phone in sleep mode that is running a javascript timer function, it will become paused.
As I need a timer for a certain application – that needs to continue to record the time and display it, updating the innerHTML of an element ever second: how do you think I should go about getting this timer to work?
Thanks for the grand help!
When the phone wakes and the app goes back to foreground,
startTimeshould still be the original time when you started counting, so you just need to know the diff between now and then. It doesn’t need to update the display while asleep; it just needs to know the time since the original starting time.