Getting response time from keyboard component

Thanks @dvbridges ,

I tried this, but maybe I am not fully understanding this.

I have set up a keyboard with the name key_resp in the Builder.
Now I am trying to access response times with the following lines at the end of the routine in which key_resp is defined:

keys = key_resp.getKeys()
for thisKey in keys:
    rt = thisKey.rt

But the variable rt stays empty.

What am I doing wrong here?