Your browser can show you stick drift. It cannot show you your controller's real polling rate. Here is where that line sits, and a short script to measure the part it can.

Disclosure: I built ControllerTest (https://controllertest.com), a free browser gamepad tester. This post is based on what I learned writing it.

What the Gamepad API gives a web page

navigator.getGamepads() returns a snapshot of every connected pad: an axes array of numbers from -1 to 1, and a buttons array. It is a snapshot, not an event stream, so you read it again every frame. Two practical details:

  • A page usually does not see a controller until you press a button on it.
  • With the standard mapping, axes 0 and 1 are the left stick and axes 2 and 3 are the right stick.

Measuring stick drift (the part a browser can do)

With the stick untouched, a healthy axis reads close to 0. Drift shows up as a resting offset that does not go away. The simplest honest measurement is the peak distance from center over a few seconds:

function measureRestingOffset(gamepadIndex, seconds = 10) { return new Promise((resolve) => { const peak = { left: 0, right: 0 }; const start = performance.now(); function frame(now) { const pad = navigator.getGamepads()[gamepadIndex]; if (!pad) return resolve(null); // controller disconnected const left = Math.hypot(pad.axes[0], pad.axes[1]); const right = Math.hypot(pad.axes[2], pad.axes[3]); peak.left = Math.max(peak.left, left); peak.right = Math.max(peak.right, right); if (now - start < seconds * 1000) requestAnimationFrame(frame); else resolve(peak); } requestAnimationFrame(frame); }); } // Put the controller on a table, press a button so the page sees it, then: measureRestingOffset(0).then(console.log); // e.g. { left: 0.02, right: 0.01 } 

Using the peak instead of the average matters: one bump can raise it, so run the test two or three times and judge the usual value.

How to read the number is a judgment call. On ControllerTest I use rough bands: up to 0.05 is normal, 0.05 to 0.12 is minor, above 0.12 is likely drift. Those are my own rule of thumb, not an official standard, and games hide small offsets with a deadzone anyway. Compare with a known-good controller of the same model before you decide a stick is worn.

I checked the logic of this script with a simulated pad (a resting stick at 0.03 and -0.04 reports 0.05, a single bump to 0.20 on the other stick is caught, a disconnect returns null). I have not tested it with a physical controller, so treat the thresholds as a starting point.

What a browser cannot measure

  • Polling rate. The loop above runs once per display frame (requestAnimationFrame), so a page sees the controller at the pace of the screen, not necessarily at the pace the controller sends reports. A number labelled "polling rate" in a browser is an estimate of what the page saw. Be careful with tools that show a very high figure without saying how it was measured.
  • Input latency. A reaction test measures you plus the whole chain: your reaction, the browser, the display. It does not isolate the controller. Measuring controller lag needs outside hardware.

I would rather say that plainly than show a precise-looking number the method cannot back up.

Try it

If you want to see the drift test run on your own controller, it is here: https://controllertest.com/tools/stick-drift-test/. If you want to fix a drifting stick, I wrote a step-by-step guide: https://controllertest.com/guides/how-to-fix-stick-drift/.

If you spot something wrong in the logic or the bands above, tell me in the comments.