USB 1Khz Latency
Brief
To measure gamepad latency, I have simply connected a logic analyzer up to a button, and the USB data lines.
In this way, we can measure the exact time it takes for the gamepad button state to be reflected on the USB data lines. All other latency is irrelevant and will be host-side.
First Packet
In this packet, we see a hex value array which represents the button states.
We see: 0x01, 0x03, 0x62, 0x00, 0x00 …. etc
Button Press & Second Packet
Here, I have set up a marker between the button initial press time, and the next USB packet.
We can see the distance/latency is 723us (microseconds), or less than 1ms.
We can also see that byte 5 is updated to 0x04, which reflects the button press being registered in the outbound USB packet.
Final Notes
It’s important to note that this is the best case scenario. In many situations this rate can vary, because of gamepad tasks that are processing, or USB bus contention, a packet may get rejected or skipped, resulting in a refresh rate closer to 800-900Hz.
Even so, your nominal latency is 1-3ms accounting for packet loss/NAKs, maybe a bit more.