Using requestAnimationFrame() to record stimulus onset and key press? #2508
Unanswered
chester108
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a custom plug-in that presents participants with 3 onscreen stimuli. As the experiment depends on having very accurate time recording, I would like to implement requestAnimationFrame() based on this thread and repository to record stimulus onset and key press time for each trial and save these as two separate variables.
Based on the thread linked above, I attempted implementing requestAnimationFrame() within two functions (one that displays stimuli on screen (DrawScreen()) and another that presents feedback (DisplayFeedback()) following button press). I've ** the lines added to try and implement this function. Two variables are produced, one that saves time of stimulus presentation (trial_onset) and another that saves time of decision/feedback (decision_onset). I am curious if this is the correct implementation or if I should be adding anything else to ensure timing is accurate? (i.e., in the thread and repository, there are "check timeout" functions also implemented which I have not done in this case). Any tips or feedback is greatly appreciated. Thank you!!
Note, on checking the data - it seems that decision_onset is being incorrectly recorded.
Beta Was this translation helpful? Give feedback.
All reactions