I would like to use this API to stream byte data over to a USB device, with the message sent from javascript running in a web browser.
The problem is, I need the latency to be really low, preferably under 2 milliseconds.
I tried a different solution, just sending a regular XMLHttpRequest via javascript to a server running on localhost (and then the local server could then easily interact with the USB using some native API), and the latency was about 20 milliseconds, but that won't work for my application.
I haven't tried websockets yet (or some other solution if one exists?), but I'm concerned the latency there might be too high as well, from what I've read it's not that great of a performance improvement (though I could be wrong)
If I use this library to try to send data to a USB device via javascript, what would the latency be? How long could I expect the data to reach the USB after sending the command in javascript?
Or if there is anyway at all to send a message from javascript to some running process on the desktop with a latency under 2 milliseconds, that would really help.
Any help appreciated, thanks