Recorded duration time or 'end time' for experiment?


I am trying to calculate the average time it takes participants to complete my Pavlovia task, however, when I download the individual csv files, I can only see the start time in each participant’s file as opposed to an end time or a total duration.

I do see when I am in Gitlab that when I hover over each datafile there is a ‘last updated’ time that pops up (thanks to this thread → Duration of Experiments) However, I was not sure if there was a way to download the data so that I could see this ‘last updated time’ for all participants in one file, rather than hovering over each individual file to see this last updated time stamp (we have a lot of data!).

I’m not sure that is possible/ perhaps I needed to code this in PsychoPy beforehand!

Apologies if there is an obvious answer that I’m missing. I’m very new to building experiments/Pavlovia.

Thanks kindly in advance for any suggestions/help!

Hi @cstewardson, I think it should be easy to record the starting time and the end time of the experiment and calculate the difference with some js code in “Begin Experiment” and “End Experiment”. Have a look at this: How to Get Current Date & Time in JavaScript? and this The resulting difference you can then save to the data itself. Hope that helps!

Hi @ajus, Thank you SO much for your reply. These posts are incredibly helpful! I did have one clarification/follow-up question!

It sounds like these codes are to be added before you start collecting data - is that correct? I thought that was most likely the case, but thought I would check (just in case there is hope for my data and I could add them in after the fact!). I’ve already collected all of my data so it sounds like I may not be able to calculate the average duration for this experiment using this method? If that is the case, at least I know how to do this for next time :).

Thank you again for your help!

Ah sorry, I missed that you asked with respect to data that is already collected. Yes, my suggestion only works when the code is implemented beforehand. If you are very eager, you could of course add up all reaction times (and onset times) for each participant. But depending on the complexity of your experiment that sounds like hell :smiley:

Thank you @ajus! And no worries at all - I don’t think my initial message was that clear! At least I know for next time though :D. Thank you so much again!

If you want to check the duration for existing data then you need to compare the start time saving inside the data file with the commit time on Pavlovia (which happens at the end).