DEV Community

Irfan Ullah
Irfan Ullah

Posted on

Why My IQ Test Has a 15-Minute Timer (and Why That's Harder Than It Sounds)

Why My IQ Test Has a 15-Minute Timer (and Why That's Harder Than It Sounds)

When I published my first post here about how the scoring on IQCognify works, a few people asked about the other design decision that shapes every result: the timer. The test gives you 15 minutes for the full run. That number wasn't picked to create pressure. It exists because of what the test is trying to measure — and enforcing it fairly in a browser turned out to be one of the harder engineering problems in the whole project.

Timing is part of the measurement

Working memory and processing speed are real components of cognitive ability, and every standardized test accounts for them. An untimed puzzle test mostly measures how long you're willing to sit there. A timed one measures something closer to how you actually think: pattern recognition under mild constraint, decisions made without infinite deliberation.

But the moment you add a timer, you take on an obligation: the clock has to be fair. A fair timer never punishes someone for a slow network, a background tab, or a laptop that decided to run a virus scan mid-test.

The three ways a browser timer lies

1. Tab switches. Browsers throttle JavaScript timers in inactive tabs — a setInterval that fires every second in the foreground may fire once a minute in the background. Count ticks and your clock drifts. The fix is to never count ticks at all: record a start timestamp, and compute elapsed time from Date.now() differences every time the UI updates. Throttling then affects how often the display refreshes, never how much time has actually passed.

2. Slow asset loading. If question images load lazily, a user on a slow connection spends their 15 minutes watching spinners. Every question asset in the test is tiny and preloaded before the clock starts, so the measured time is thinking time, not download time.

3. Server round-trips. If the timer lives on the server, latency becomes part of the test. The whole run — questions, timing, scoring — happens client-side. The server never gets a vote on how long you took.

The edge case nobody warns you about

Sleep. A laptop closing mid-test can produce a four-hour "elapsed time" on wake. The honest handling is to detect a discontinuous jump in elapsed time and end the session rather than score it — an unscored attempt is a better outcome than a garbage score presented as real. Silent data corruption is worse than a lost session, in testing and everywhere else.

Why 15 minutes

Long enough that the constraint is mild for most people, short enough that speed still differentiates. It's a calibration choice, and like the scoring model, it should be a deliberate one — if you build anything similar, decide what your timer is for before you decide how long it is.

The test itself is live at IQCognify if you want to see the timer behave — 27 questions, no signup, and your time is measured by timestamps, not ticks.

Top comments (0)