When working with milliseconds, there's a lot to consider
- the browser
- the respondent's computer (CPU, RAM) incl. Internet connection
- the JavaScript enging
- the display connected to the computer, it's refresh rate and the actual latency
- the graphics card
- loading times in the browser
- rendering times in the browser
- the operation system
... and probably some more things. Note that the typical display display rate is 60 Hz, which makes about 16ms per image. And you never know if the browser will have sent the image to the graphics card just before of after a refresh. You also have some afterglow on some displays.
So my opinion ist that getting to a reliable resolution of +/- 30 ms is the best you can hope for. That means, if you plan for 30 ms, the actual display time will be between 0 and 60 ms.
And please note that even 30 ms is two frames and not considered subliminal.
Using software that runs directly on the computer (probably Java won't do, as it's running in a virtual machine with limited hardware access), the it should be possible to tell the display what to show with each refresh (16 ms). Any maybe, the graphic engines of modern browsers will allow for that as well. But implementing code for them will be much more complex than just setting a JavaScript timer and change the style attribute of a HTML node. If you have a online game designer at hand, that's a good option to ask for details.