Providing feedback when no response for 3 sec

Hello!

I am presenting a text for 3 sec and have keyboard response after that. In a separate routine after the presentation trial I would like to present Feedback ONLY if they do not respond longer then 3 sec. I wrote
if not key_resp_sentence.keys :
msg = “Too slow”
else:
msg = ’ ’

This works. But my wish is that there is only feedback when there is no key press, otherwise nothing
Please help me. Many thanks

The way I do this is to put a loop around the feedback routine with a variable nReps (1 for feedback needed, 0 for not needed)

Best wishes,

Wakefield