Reaction time in milliseconds

What are you trying to achieve?:
Reaction time in milliseconds (e.g., 300.34)

This is an letter-sequence protocol, with
Cue
Distractor letter1
Distractor letter2
Probe

Essentially I am trying to obtain the reaction time in milliseconds from:
Cue STARTED to Cue STOPPED
and
Probe STARTED to Probe STOPPED

My response element is labelled key_resp, allowing left (incorrect) and right (correct) arrows to be pressed.

What did you try to make it work?:
Based on a previous post (How can I measure reaction time in milliseconds?), I put a code component at the beginning of a routine, with the following line in the End Routine tab:

thisExp.addData('key_resp.RT in ms', key_resp.rt * 1000)

What specifically went wrong when you tried that?:
In the Excel data file reaction time comes up as: [1.063594] for each response. I am guessing that this is in the absolute seconds/time since initiation of the experiment.

In addition:
I wondered if there was a way to provide feedback as a percentage of correct responses after a certain amount of loops (e.g., %correct 20 loops into the experiment). If anybody has any suggestions I would be incredibly grateful.code

Is this in the new column you added? The code you’ve used adds a ms column in addition to the original rt column, it might just be over to the right as it was added manually.

There is, yes! You could create a Text component with its value set to $percent_correct and create a variable by that name. You would need to create the variable at the beginning of the experiment so this Text component has something to go on, but you can just set the value to "". You can then set this variable each trial using a code component, something like:

if trial > 20:
    percent_correct = mean(isCorrectArray)

with isCorrectArray being a list of bool items stating whether their response in each trial was correct.

Thanks, Todd!

Apologies for my slow reply. I am being moved to a different office, and different computer, at work so daren’t attempt any changes to mt PsychoPy files just yet. I am going to give this a go when the move is complete over the next week or two!