I'm trying to create a simple reaction time (RT) task in javascript, and I'd like to have roughly 1 ms resolution. I've been testing some simple code to see if the distribution of RTs looks as expected. Basically, the script uses performance.now() to grab the time as soon as a key is pressed, and it compares that time to the previous key press time. In other words, I'm getting a simple distribution of times between keypresses.
To my surprise, the distribution was binned in 8ms intervals. For instance, there were peaks at roughly 120 ms, 128 ms, 136ms, etc. (decimal values are returned since I'm using performance.now()), but there were empty gaps in between. I've seen the exact same thing whether i'm using Firefox, Chrome, or Safari. What is causing this granular timing? Is this a limitation of my operating system, or of the browsers? Is there anything I can do to stop this binning and gain millisecond resolution? If it helps, I'm running OS X El Capitan on a 2012 Macbook Pro. Thanks!