timo
Ahh, that makes sense. It's a good feature that the timer can keep running even while the app is not. I can see how this is also beneficial when using multiple devices to manage the timer, such as when starting the timer on my laptop (which syncs the timer via iCloud), and stopping the timer on my iPhone (which also syncs the timer via iCloud).
I hope you don't mind me brainstorming, I like your app and want to keep using it. I'm also a developer as well.
The solution could be to have two layers of (start_time, stop_time) pairs. The top-level timestamps would correspond to the timer entry (e.g., timer_start, timer_end), and the low-level timestamp pair would correspond to the running clock (e.g., running_clock_start, running_clock_stop). You can increment the running_clock_time when the user pauses or stops the timer using:
running_clock_time = running_clock_time + (running_clock_stop - running_clock_start)
And for simplicity, you can set 'running_clock_stop' to nil while the clock is running. So in this scenario, you can calculate the current running_clock_time in real-time (to display on the UI), on the fly via:
current_running_clock_time = running_clock_time + (current_time - running_clock_start)
You can also calculate the break_time value in a similar way from the timer_start, timer_end, and running_clock_time values.