{
  "id": 8033798,
  "title": "Can JavaScript Measure Mouse Polling Rate?",
  "url": "https://urgent.news/2026/09/17/can-javascript-measure-mouse-polling-rate",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-17T14:08:09.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/umairaalam/can-javascript-measure-mouse-polling-rate-3eh6"
  },
  "original_language": "en",
  "account": "The polling rate of a mouse refers to how often it reports updated information to the computer. This is typically measured in Hertz (Hz), with higher values indicating more frequent updates. Here are some common polling rates: 125Hz (8ms interval), 250Hz (4ms interval), 500Hz (2ms interval), 1000Hz (1ms interval), 2000Hz (0.5ms interval), 4000Hz (0.25ms interval), and 8000Hz (0.125ms interval). The relationship between polling rate and interval is straightforward: pollingRate = 1000 / intervalInMilliseconds. However, measuring this rate in a JavaScript context is more complex than simply assuming the mouse reports at the same rate as the browser. This is because the JavaScript code runs at the end of a long input processing chain, involving hardware, firmware, USB/Wireless connection, operating system, browser input processing, and finally the pointer event reaching JavaScript. When measuring mouse polling rate in JavaScript, a common approach is to listen for the pointermove event. This involves calculating the time difference between consecutive pointermove events to estimate the frequency. For instance, a 1ms interval would correspond to approximately 1000Hz. However, this method can be misleading. Browsers often combine multiple pointer updates into a single dispatched event to optimize performance, a process known as event coalescing. This means JavaScript callback frequency may not always match the actual frequency of mouse hardware reports. There are two main pointer events developers can use: pointermove and pointerrawupdate. The pointermove event may be coalesced, while pointerrawupdate is intended to be dispatched more frequently. However, even pointerrawupdate does not provide direct access to mouse firmware or USB packets. It's important to understand that JavaScript callback frequency may not necessarily match the actual frequency of mouse hardware reports.",
  "summary": "A gaming mouse may be configured to 1000Hz, 4000Hz, or even 8000Hz, but open a browser-based test and you may not always see exactly the same number. Why? The obvious assumption is that if a mouse reports at 1000Hz, JavaScript should receive 1000 mouse events every second. That sounds reasonable, but browsers do not work quite that directly. JavaScript can measure mouse movement timing, but it…",
  "key_points": [
    "Mouse polling rate measures how often mouse reports updated information to the computer.",
    "Measuring mouse polling rate in JavaScript is complex due to multiple processing layers.",
    "JavaScript callback frequency may not match actual mouse hardware report frequency."
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}