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,
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:And the following
inline_script
(in the Run phase) immediately after the response item that ends the experiment:This will give you two timestamps in milliseconds, and the difference between them indicates how long the experiment lasted (in milliseconds).
Yes, the
mouse_response
item will give you a response time, just like other response items!Cheers,
Sebastiaan
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.
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:
Does it work then?
Eduard
Hey!
Yes, worked very well! Thank you so much for your help! Finally the computer with a good configuration has arrived and I can now start the experiment!!