Howdy, Stranger!

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

Supported by

Timing doubts: calculating experiment duration and mouse response

Hi there!

I was wondering if it is possible to achieve the duration of the experiment. I need to know how long it took between: the participant hit the key that starts the experiment until he has finished responding to the last trial. Is that possible?
In my logger the datetime is coming out, but I need more information.

Another question: Is it possible to collect the response time when I am using the mouse response?

Comments

  • Hi,

    I was wondering if it is possible to achieve the duration of the experiment. I need to know how long it took between: the participant hit the key that starts the experiment until he has finished responding to the last trial. Is that possible?

    You can derive the duration of the experiment in various ways, but the easiest way is probably by explicitly setting a variable for the start and the end time.

    So you could insert the following inline_script (in the Run phase) immediately after the response item that starts the experiment:

    var.experiment_start_time = time.clock()
    

    And the following inline_script (in the Run phase) immediately after the response item that ends the experiment:

    var.experiment_end_time = time.clock()
    

    This will give you two timestamps in milliseconds, and the difference between them indicates how long the experiment lasted (in milliseconds).

    Another question: Is it possible to collect the response time when I am using the mouse response?

    Yes, the mouse_response item will give you a response time, just like other response items!

    Cheers,
    Sebastiaan

    There's much bigger issues in the world, I know. But I first have to take care of the world I know.
    cogsci.nl/smathot

  • edited May 4

    Hi Sebastiaan! Thanks for your help again. I was trying before and couldn't get the mouse outputs, but I re-did the experiment from scratch and it worked.

    This will give you two timestamps in milliseconds, and the difference between them indicates how long the experiment lasted (in milliseconds).

    I tried what you said, to put the inline_scripts but an error message appears:
    Inline script, line 1, in
    NameError: name 'time' is not defined

    Did I do something wrong?

    Regards,
    Ana Clara

  • Hi Ana Clara,

    If you replace the two lines with these two here:

    var.experiment_start_time = clock.time()
    var.experiment_end_time = clock.time()
    

    Does it work then?

    Eduard

Sign In or Register to comment.