giftjames.blogg.se

Psychopy code reaction time round
Psychopy code reaction time round















If the wait period was, say, 1900 ms, regardless of the key actually being pressed at 200 ms, your measured RT value will be slightly later than 1900 ms, as you are measuring when the keypress was processed, not when it occurred. Note that this time bears no relationship to when the key was actually pressed. Then when the wait period is over, you call event.getKeys() and, if there was a keypress, record the current time.

#Psychopy code reaction time round code#

Because your PsychoPy code is doing nothing active during that period, that keyboard event will indeed just sit there in the buffer going stale. What will happen is that you press a key, at some time likely quite early in the wait period, which then simply goes into a buffer waiting to be processed. it makes no sense to display a stimulus, then use a period of core.wait() to have it shown for a variable amount of time, and then check for a response with event.getKeys(). It’s just a convenience function for non-time critical purposes.Į.g. You need to abandon your use of core.wait() if you care about timing. # Add to trial and initialise a new trial # Count an error if space is pressed and the letter is the target # Count a hit if space is pressed and the letter is not the target # Display the fixation cross for a random interval between 19 milliseconds

psychopy code reaction time round psychopy code reaction time round

# Display the stimulus for 100 milisecond

psychopy code reaction time round

A minimal example of the code is the following: trial = 1 I’m running PsychoPy v1.85.3 on Debian GNU/Linux 8 (jessie). My guess is that core.wait() is adding time to the RTs, but if I subtract the trial by trial core.wait() times to the RTs I obtain a value far shorter than expected, in the implausible order of 1 * 10 ^ -4. They are in the range of 2 - 4 s, while I’m sure I’m pressing the response key (SPACE) a lot sooner (< 1s). I’m programming a sustained attention task, but I have reaction times longer than expected.















Psychopy code reaction time round