We have recently acquired a 1000Hz keyboard, so I am trying to take advantage of this high sampling frequency. Imagine a simple experiment in which a visual stimulus is presented on a 60 Hz monitor for say 600ms. Imagine two experimental conditions that do not generate any effect on RT. In other words, the true population means of conditions 1 and 2 are identical. Now imagine that we code a given trial of the experiment in the following way:
RTclock =core.Clock() event.clearEvents(eventType='keyboard') stimulus.draw() Mywin.flip() # display stimulus RTclock.reset()#start clock While True: t = RTclock.getTime() if t >= .6: Mywin.flip()#remove stimulus key_press = event.getKeys(keyList=["-->keys associated to possible responses"]) if len(key_press) > 0: RT = RTclock.getTime() #-->store RT and key pressed break #don't call the flip method at every frame (which would necessarilly put a 60 Hz constraint on keyboard polling rate)
I would appreciate some advice/insight on the following issues :
1-The call to the flip() method to remove the stimulus is going to block the code until the next screen refresh cycle. Say we sample more RTs during this blocking period in condition 1 than condition 2 by chance. Can this generate a spurious RT difference between conditions 1 and 2 ? Would you recommend to use ioHub here, or simply use my coding scheme ?
2-600ms corresponds to exactly 36 frames. Should I really expect some code-blocking latency when calling Mywin.flip() to remove the stimulus? Should I call Mywin.flip() a little before 600ms (e.g., if t >= .59) to ensure that the stimulus will be removed at t = 600ms?