Starting a race at the same time

The Clan Race app was designed to be a tool to run friendly races. Race organizers can choose to let runners start at the same time, or any time within a timeframe. Win or lose, everyone should enjoy the journey of a race.

To start a race at the same time, currently it can be done by the race admin keeping the race invisible to all runners until a particular time. Then, at the selected time, the race admin can make the race visible, so that registered users of the app can see it on the list of races and join it.

There is nothing wrong with that method, but we thought we could make the start more exciting by having a countdown to start. In a type of races called First to Finish, race admin can set a cut-off time for users to register in the race. Only those who register as a runner before the cut-off time can participate. After the cut-off time, the race is closed to those not registered beforehand. In addition, a countdown clock will be displayed so that registered runners can see how long until the race starts.

We have done that in the app. If a race admin ticks a box that will designate the race as a First-to-Finish race, then a registration cut-off time and the race start-time will be set.

We tested it with our own smart phones, and the FTF set-up seems to work. However, we soon found that it had a problem, because the clock on each mobile device is set independently from others, and its owner may even set its own time, but our cut-off and race start time were based on the device’s clock.

So two runners of the same race standing next to each other might see different countdown time to the start of the race. If runner A’s clock was at 10am, and runner B’s clock was at 10:03am, and the start time was 11am, then countdown for runner A would be 60 minutes, for runner B would be 57 minutes, and the start time would also have the same difference, which would not be good for a competitive race!

After a few days of research and thinking, our developers finally came up with a solution. The clock time from a runner’s device is measured against the app’s server’s clock. The difference is used to adjust the countdown clock. So all countdown clock in runners’ devices will show the same time with a variance of no more than two seconds. This means that a First-to-Finish race will have the same start time (+/- 2 seconds), regardless of the clock time on the devices.

This means that the First-to-Finish race format is ready for race organizers!