A user focuses for 3 minutes and 40 seconds, stops to answer the door, and later does another 2 minutes and 20 seconds. How many whole minutes of work should your app show? Six. Round down each session independently and you get five. It’s a small bug until the missing minute is the one someone needed to unlock something.
I make Focusgotchi, an iPhone focus timer where a pixel pet grows as you work. The same interval matters in three places: the countdown, the pet’s growth, and the coins on the session receipt. Here are two implementation decisions behind that little room on the screen.
A countdown needs a deadline
A repeating UI callback is useful for drawing the seconds. Depending on a callback firing exactly once per second makes it a poor record of elapsed work. Think about what should happen when a user starts a 25-minute session, locks the phone, and returns ten minutes later.…