Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Getting the time of a keyboard response

Hello,
First of all, this is a great community, so thank you for all you do.

Now my issue:
Im trying to get the time of a keyboard response, not the response time, but to get the time for when the keyboard was pressed in regards to the start of the experiment.

I'm aware this should be quite easy with inline scripting, but i'm still a beginner at programming.

Thanks in advance for your help,

Arturo.

Comments

  • Hi Arturo,

    It would be best to place an inline_script right after your keyboard response with response_moment = self.time()-start_time in the run-phase.

    At the start of your experiment you place another inline_script with start_time=self.time() in the run-phase.

    Cheers

    Josh

  • Thank you very much. It seems to work (at least it does not crash), but in the log file i'm getting "NA",
    Any clue to why this might be happening?

  • Hi Arturo,

    Probably you want to save the variable as var.response_moment = self.time() - start_time. This should make sure that the variable is written to the logfile properly.

    Eduad

    Buy Me A Coffee

Sign In or Register to comment.