Race Timer
- In testing
- Built by one person
- Since July 2026
- Worst case over 150 signals on a real watch: 61 ms from the mark
Race Timer is a watch app that runs the countdown to a sailboat race’s start and sounds each signal on the wrist, with the screen off and no phone nearby. We built it for Wear OS watches, and it’s in testing on a real one.
The problem
A sailboat race starts on a countdown, with a sound signal at each fixed mark, and a sailor times the run at the start line by those signals. A signal that sounds late is worse than none, because it’s wrong in a way the sailor can’t see. The first build’s countdown digits were always exact, and its signals still went out late by a different amount each time, because nothing on the screen could show when a sound actually played.
What we built
A watch app with six built-in start sequences, a face that changes colour as the start runs down, and a vibration matched to every signal. Then we rebuilt how it sounds them: everything a signal needs is prepared before it’s due, so at the moment it’s due, the watch does nothing but play it.
What it proves
We measured it rather than trusting it. On one watch, across 150 signals in five complete race starts, the worst case was 61 milliseconds from the mark. This page quotes the worst case, not the average, on purpose: a case study is read as a guarantee, and the worst case is the one you’d be held to.
Nothing in the project times the sound leaving the speaker, so that last step was checked by ear: a full start sequence on the wrist, with the beep and the buzz arriving as one event.
Why it matters: anything that has to happen on time, like a reminder, can be measured the same way, worst case first.

Have a problem like this in your business?
If you hire us for a build within 60 days, the full $1,500 counts toward it.
The technical detail, for developers and agencies
Each figure is dated to when it was measured.
- Built by: one person. Design, code, measurement, and testing on the water.
- Stack: Kotlin, Jetpack Compose for Wear OS, AudioTrack, and a pure-Kotlin timing module shared with a phone build.
- Timeframe: July 2026 to now. Still in progress.
The problem, in detail
A sailing start is a countdown with sound signals at fixed marks. The countdown on the first build was never wrong: it read a monotonic clock and recomputed, so the digits were exact. The sound was wrong, and in a way nothing on the screen could show. The service found each cue by polling every 50 ms on the main thread, so every signal fired 0 to 50 ms late at random, and whatever the main thread was doing at that moment roughly doubled it. A horn that is late by a different amount every time is a horn you cannot judge a line by.
Underneath that, the platform tone generator overshot its requested length and did so non-deterministically: 150 ms came out at 160, and a 500 ms request delivered 512 ms five times and 520 ms once in the same race. No padding can correct a number that will not hold still. And the audio output closed itself between blasts, charging about 54 ms to reopen on whichever blast came next, so a three-blast cue meant to sound 400 / 400 sounded 346 / 454. That one was found by a sailor’s ear after the dispatch log had sworn it was even.
What we built, in detail
The app itself: six built-in sequences, a face that changes colour as the start runs down, a vibration pattern per signal matched to its sound, a sync to the nearest minute, restore after the process dies, and two race-committee modes that keep counting after the gun. A phone build shares the timing code and is unpublished.
The part that mattered is where the rules live. The timing engine is a pure-Kotlin module with no Android in it, so every timing rule has a unit test CI runs; the watch and phone modules never name each other. Every fix that started as a line in the service moved into that module once it was clear that a rule left inline had stayed wrong for two weeks while every call reported success. As of August the shared module ran 367 tests.
The other half was instrumentation. Nothing here was tuned by ear alone, because three instruments once reported success on a watch that was making no sound at all. The service logs how far each cue fired from its mark, the audio layer logs how late its buffer went out and how many frames the hardware consumed, and a full race on the wrist is the unit of measurement rather than a single cue.
A decision we’d defend
Nothing on a cue’s deadline is allowed to do work. Not poll, not synthesise, not call the audio server. Everything a cue needs is done before the deadline, and the deadline itself is a single buffer write onto a track that is already running.
Concretely, that is three things. The engine exposes when its next cue is due and the service arms a timer on that exact boundary; the 50 ms poll survives only to drive the display and to backstop a missed wake-up. Each cue is rendered ahead of time into one PCM buffer that carries its tones and its silences, so no blast can pay an output restart in the middle of a cue. And the track is started once before the race and never paused, with a 10 ms silence written every 300 ms so the mixer does not drop a starved track and hand the restart cost back to the next write.
That last piece is the one we’d defend hardest, because a negative control without it passed the story’s own acceptance criterion. With the heartbeat off, the first cue of a race was 40 ms late, under the 50 ms the criterion asked for, while every cue after a gap of ten seconds or more paid 6 to 88 ms on the write. A criterion written as a threshold on one cue could not price the mechanism; only the full race could.
What it rejected, and why:
- Tune the platform tone generator. The obvious first move was swapping tone families. Measured, the swap delivered the same 160 ms for a 150 ms request. Reverted, with the numbers recorded on the constant so it is not attempted a third time.
- Calibrate the haptics to the delivered audio lengths. That bakes one watch’s numbers into an app headed for other watches, and cannot fix non-determinism anyway: there is no single number to calibrate to when the same call returns 512 and 520.
- Post every blast to the audio thread symmetrically. Latency is not uniform across blasts. The first must wake an idle thread and arrived up to 30 ms late; later ones were queued against a thread already awake. The first interval compressed to 722 ms against 750, which is the same asymmetry the bug report complained about, relocated rather than removed.
- Set the lead-in to zero for a faster first cue. A one-constant change that turned out to alter message ordering: with no lead-in, the play call could sort ahead of the buffer write on the handler, which is intermittent silent wrong audio. Its three good readings were luck; a normal run gave 213 ms.
- Raise the render thread’s priority so the first cue is ready in time. Both threads started level, so a faster loser is still a loser. The fix was a head start: warm up from the service’s own creation, which runs before first paint, rather than from the connection callback, which looks early and queues behind the first composition.
The cost is honest. The audio path is more code than a single tone call. The always-running track needs an API level the app’s minimum does not guarantee, so older watches keep the flush-and-play path and its first-cue penalty. And a cue written while a heartbeat chunk is draining can sound up to 10 ms late; that is reported rather than corrected, because writing a cue early risks sounding a signal before its mark, which is the one error a sailor cannot recover from.
One more thing had to be true for any of this to hold: the CPU has to be awake. The scheduled timers run on a clock that stops in suspend, so a single partial wake lock sized to the race is load-bearing for every cue. It was sized once at start, and a sync to the minute could lengthen the race by up to 30 s without re-sizing it; two round-up syncs spent the whole margin and the lock expired with no callback. Re-arming it on every sync fixed that, and the fix was measured with the screen off from start to gun rather than assumed.
Outcome
Measured on one watch in August 2026: 150 cues across five complete US Sailing start sequences, cold and warm process, both audio routes. The worst case over the 150 cues was 61 ms from the mark at dispatch, and 101 ms at tone onset, which includes a deliberate 40 ms lead-in. No cue was delivered short: 0 of 150. A separate run with the screen off, from start to gun, dispatched 30 cues at most 4 ms from their marks and finished 0 ms off end to end.
The dispatch median is 2 ms. A bound stated at the observed maximum is the one the next device falsifies, so the app’s own documentation claims 100 ms dispatch and 150 ms tone, with the headroom deliberate. The worst run was the fifth, the one picked up and worn for the by-ear check. The four left on the charger were the optimistic tail.
Status: signed and uploaded to Google Play’s internal testing track from CI on a tag since August 2026. As of late September its installed audience was still 0, because the watch’s store setup was unfinished, and a public listing needs a closed test with twelve testers over fourteen days, which had not started.
If you hire us for a build within 60 days, the full $1,500 counts toward it.
Run an agency? Send us a project