Hi Lazaros
You would reset the clock at the beginning of the trial and then record the elapsed time when return is pressed. So it would contain some of these elements:
# Initiate clock
trialClock = core.Clock()
# Loop through trials
for trial in trialList:
# Present trial
stim.draw()
win.flip()
trialClock.reset()
# Record response
response = event.getKeys(['return', 'r', 'g', 'b']) # allowed responses
if response:
trial['rt'] = trialClock.getTime()
if response[0] == 'return': trial.finished = True
if response[0] in ['r','g','b']: trial['answer'] = response[0]