webhid icon indicating copy to clipboard operation
webhid copied to clipboard

Determining latency of WebHID signals

Open loucadufault opened this issue 1 year ago • 2 comments

Opening this issue since there is little to no discussion or documentation relating to the performance of WebHID, with respect to the latency of data reports received from the device or sent to the device.

I would like to know:

  1. if there is any existing guidelines or work around measuring the latency, specifically as it compares to interfacing directly with the device on a (non-Chrome) program using native APIs
  2. if there is any way to benchmark or see timings of reports from Chrome

chrome://device-log only shows connection events so cannot use it to determine timings of reports.

Also there do not seem to be any relevant flags in chrome://flags.

I am hoping maybe there is some capture output that can be seen somewhere else, or at least some benchmarks from the initial implementation that are publicized.

loucadufault avatar Feb 05 '25 16:02 loucadufault

We haven't tried measuring latency compared to native APIs and there isn't anything built into Chrome that would help with this.

Wireshark can capture USB traffic, you could use this to get the timing of HID reports. Wireshark can also capture Bluetooth HID traffic if you use a USB-connected Bluetooth adapter.

nondebug avatar Feb 12 '25 22:02 nondebug

Thank you for the Wireshark idea @nondebug . If I get any interesting findings I'll report back here.

loucadufault avatar Feb 13 '25 14:02 loucadufault