Skip to content

Timing accuracy

Wondering if jsPsych can be used for research that depends on accurate display times or response time measurement? For most purposes, the answer is yes.

Display timing is somewhat less accurate in JavaScript than in standard experimental software that runs on a desktop. Desktop software can have closer integration with the graphics devices of the machine than JavaScript currently permits. If a one or two frame (17-33ms) difference in display timing matters for your experiment, then you'll want to be careful with JavaScript-based experiments. It is possible to achieve this level of control in JavaScript, but it often requires code that is more tailored to your experiment and some restrictions about which browsers can be used to run the experiment.

Tip

If you are hoping to run an experiment with the best timing that jsPsych can offer, we currently recommend using the jspsych-psychophysics plugin developed by Daiichiro Kuroki.

Kuroki, D. (2021). A new jsPsych plugin for psychophysics, providing accurate display duration and stimulus onset asynchrony. Behavior Research Methods, 53, 301–310. https://doi.org/10.3758/s13428-020-01445-w

Response time measurements in jsPsych (and JavaScript in general) are comparable to those taken in standard lab software like Psychophysics Toolbox and E-Prime. Response times measured in JavaScript tend to be a little bit longer (10-40ms), but have similar variance.

References

See the following papers for extensive work on display and response timing in browser-based experiments.

Note that browsers are updating frequently and the JavaScript language specification is also changing. It's possible that the results from these papers do not apply to current versions of web browsers.

Future updates to JavaScript APIs will likely improve the ability of online experiments to provide more accurate display timing and response time measurement.