Reaction Time in Feedback

Hi! I want to add the Reaction Time within giving feedback. What kind of command should I use?
I’m new to the PsychoPy.

Let’s say you have a keyboard component called key_resp. Then in a text stimulus on the next routine, you could put this in its “text” field:

str(key_resp.rt)

and set that field to update on every routine. i.e. the keyboard component will store the reaction time in an attribute called .rt and you can refer to it later. It is stored as a number, so you might need to convert it to a string of characters using the str() function. You might also want to round the result, e.g.

str(round(key_resp.rt, ndigits=2))

You might also want to embed it in a message, like this formatted string:

f'Your reaction time was {round(key_resp.rt, ndigits=2)} seconds.'

Thank you very much! It perfectly works.