I’m programming a sustained attention task, but I have reaction times longer than expected. They are in the range of 2 - 4 s, while I’m sure I’m pressing the response key (SPACE) a lot sooner (< 1s). 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. What I’m doing wrong?
I’m running PsychoPy v1.85.3 on Debian GNU/Linux 8 (jessie). A minimal example of the code is the following:
trial = 1 while trial < n_trials: event.clearEvents() # Set height and letter of the stimulus stimuli_text.setHeight(variable_height) stimuli_text.setText('%s' % variable_stim) stimuli_text.draw() mainWindows.flip() # Initialise the counter startTime = time.time() # Display the stimulus for 100 milisecond core.wait(0.1) # Draw a fixation cross stimuli_text.setText('+') stimuli_text.draw() mainWindows.flip() # Display the fixation cross for a random interval between 1900 and 3900 milliseconds core.wait(fixation_dewell_times[trial]) # Begin to listen for a key press key = event.getKeys(keyList=keyList) if key: # Get the time when a key is pressed endTime = time.time() # Count a hit if space is pressed and the letter is not the target if key == ['space'] and stim != target: hit_counter += 1 # Count an error if space is pressed and the letter is the target if key == ['space'] and stim == target: error_counter += 1 # Get the reaction time RT = endTime - startTime else: RT = -1 print RT # Add to trial and initialise a new trial trial += 1
Thanks for you help,