Precise display time measurement in JavaScript for web-based experiments.

Behav Res Methods

Faculty of Psychology, Department of Cognition, Emotion, and Methods in Psychology, University of Vienna, Vienna, Austria.

Published: April 2023

Conducting research via the Internet is a formidable and ever-increasingly popular option for behavioral scientists. However, it is widely acknowledged that web-browsers are not optimized for research: In particular, the timing of display changes (e.g., a stimulus appearing on the screen), still leaves room for improvement. So far, the typically recommended best (or least bad) timing method has been a single (RAF) JavaScript function call within which one would give the display command and obtain the time of that display change. In our Study 1, we assessed two alternatives: Calling the RAF twice consecutively, or calling the RAF during a continually ongoing independent loop of recursive RAF calls. While the former has shown little or no improvement as compared to single RAF calls, with the latter we significantly and substantially improved overall precision, and achieved practically faultless precision in most practical cases. Our two basic methods for effecting display changes, plain text change and color filling, proved equally efficient. In Study 2, we reassessed the "RAF loop" timing method with image elements in combination with three different display methods: We found that the precision remained high when using either or changes - while drawing on a element consistently led to comparatively lower precision. We recommend the "RAF loop" display timing method for improved precision in future studies, and or changes when using image stimuli. We publicly share the easy-to-use code for this method, exactly as employed in our studies.

Download full-text PDF

Source
http://dx.doi.org/10.3758/s13428-022-01835-2DOI Listing

Publication Analysis

Top Keywords

timing method
12
display changes
8
single raf
8
calling raf
8
raf calls
8
improved precision
8
"raf loop"
8
display
6
raf
5
precision
5

Similar Publications

Want AI Summaries of new PubMed Abstracts delivered to your In-box?

Enter search terms and have AI summaries delivered each week - change queries or unsubscribe any time!