So you have a routine called initialFixation
, which has a fixed duration. In that routine, you are writing an “iti”, taken from the jitter list of times. This should not be there, because you are not using jitter in that routine. Instead, if you want to record the duration of the routine, just add thisExp.addData("initialFixationEndTime", globalClock.getTime())
in the End Routine tab. You need to do this with all of your routines that are not part of the loop, because currently you are writing the iti, and it is irrelevant to routines outside of the loop. But, also add these to your loop routines, so you can see how long they are too, but remember to change the name of the column.
Also, in all of your routines where you are writing the start time, you are using “routineNameStartTime” to name your columns. In the previous examples I used routineName
as a placeholder, and the idea is you can manually add the actual routine name e.g., initialfixation
in place, which is the name of one of your routines. This way, it is clear which routine you are looking at in your datafile. So, the actual format in a more abstract way is:
thisExp.addData("column name in your excel file", saved_variable)
Also, when you do want to record the iti, you need to refer to the name of your actual loop (like you are in your fixation component), not the the one I used in my example. Your loop is called trialsloop
, so to record your iti in your data file, you would use
thisExp.addData("iti", jitter[trialsloop.thisN])
Regarding the timing, sometimes you get 7 seconds, because:
3.5s trial duration + 3.25 iti duration (max iti duration) + .25s iti onset delay == 7 seconds
You see the 7.25s trial time on your last trial, where you transition from the loop to the start of a new routine. Not sure why it is 7.25 seconds, but it is not an accurate measure the length of your trial. You should measure the time from the start of the routine, to the end of the routine, and you do this by getting the time in the “Start routine” amd “End routine” tabs in the code component. Best not to measure trial time by measuring the start of one routine to the start of the next routine, which is what you are doing in your datafile when you subtract two consecutive rows in the “routineNameStartTime” column. As you have two routines within your loop, you can add their durations together to get your trial length. Hope thats clear enough, have a go with those changes and let me know