@ryanjp
Yes. I managed to get Pavlovia to output Routine Start and End times in the datafile. First, I have separate Routines for each part of a trial. So, for instance, one routine presents a cue for x sec, followed by another routine that presents a target stimulus, etc. For each Routine you can add a code component. In the Begin Routine tab for that code component you can add:
//save cue onset times
thisExp.addData(‘CueStart’, globalClock.getTime())
Then, in the End Routine tab for that same code component you can add:
//save cue offset times
thisExp.addData(‘CueStop’, globalClock.getTime())
What this will do is place separate columns in the Pavlovia-generated datafile showing the trial’s cue start and stop times. It gets this information from the globablClock.getTime() function.
However, to use this you’ll also need to specify another code component at the beginning of your experiment that defines the variable called thisExp.
thisExp=psychoJS.experiment;
In this way, you can get Pavlovia to give you Routine durations. Note that the globalClock function gives you a value that tells you at what time the Routine, in question, was entered from the start of the experiment. Thus, difference scores will give you an idea of when the program entered and exited that Routine. If you set it up so that a particular stimulus that you are interested in measuring is tied to a Routine then this will work.
Please note, though, these values cannot be used to give you really accurate readings. There are many sources of timing variability, especially with online studies. So, the numbers you are getting with this method will tell you when the computer instruction for presenting a stimulus and turning it off was logged over the course of the study. Although those readings are accurate within the context of the program, exactly how long it takes the computer to actually present and turn off the stimulus once it receives these commands can be variable, and thats what adds to the error. However, this would give you a reasonably good estimate of when the computer was told to turn on and off a stimulus. If you don’t care that there may be error variability on the order of at least one screen refresh cycle, and possibly a bit more, then you’ll be ok.
Hope this helps. It took me forever to figure out how to do this in a simple and straightforward way…
Andy Delamater