How BrainRivals Measures Reaction Time: Implementation and Limits
A source-aligned explanation of the current reaction-time test, including timing, averaging, validation, and device-dependent uncertainty.

What the Current Test Does
Each round begins with a random wait of two to five seconds. The surface then changes from red to green. A requestAnimationFrame callback records the start timestamp close to a browser frame boundary, and the next valid click or Space-key response records the end timestamp.
The measured attempt is:
rounded attempt = round(response timestamp - start timestamp)
After five valid attempts, the displayed score is:
score = round(sum of all five attempts / 5)
The first attempt is not discarded, and the client does not remove slow attempts as outliers. The saved supporting data includes the five attempt times, the best and worst attempt, and the total elapsed session time. When a score is submitted, server-side validation checks the supporting data and recalculates the score rather than trusting the displayed number alone.
What an Early Click Does
A response before green is marked “too early.” That response is not added to the five recorded attempts. After a short reset, the same round starts another random wait. This discourages guessing without silently changing the final averaging rule.
What performance.now() Provides
performance.now() is a monotonic browser clock suited to measuring elapsed time. It avoids problems caused by changes to the system wall clock. Its availability does not make the full test accurate to a fraction of a millisecond: browser privacy controls may reduce timer resolution, and the physical display and input path remain outside the JavaScript clock.
What requestAnimationFrame Does—and Does Not Do
The test schedules the start timestamp in requestAnimationFrame after changing the visual state. This aligns the callback with the browser's rendering cycle more closely than an unrelated timer callback.
However, a frame callback is not proof that the green pixels have already appeared on the user's display. Browser composition, display refresh timing, monitor processing, and input-device latency can all add variation after or around the timestamp. For that reason, the result should not be presented as a hardware-corrected laboratory measurement.
Measurement Limitations
BrainRivals currently does not:
- detect or compensate for the monitor refresh rate;
- measure the moment pixels physically change on the display;
- measure mouse, keyboard, touch-screen, Bluetooth, or USB latency;
- subtract an estimated display or device delay;
- remove the first valid trial or filter slow valid trials;
- make results from different devices directly interchangeable.
These boundaries matter. A change in device, browser load, input method, display settings, or testing environment can move the result even when the person's underlying response is unchanged.
How to Compare Results Responsibly
Use the same device, browser, input method, and similar conditions when comparing sessions. Look at a series of scores rather than treating one best run as definitive. A personal trend under stable conditions is more informative than a claimed population percentile without a documented comparison dataset.
The test is intended for entertainment and personal performance tracking. It is not a clinical, diagnostic, or laboratory assessment.