I am trying to determine the duration of the entire routine so that it is approximately 10 minutes long. How can I do that? Should I get the starting time for the last stimuli in the routine? In my case it is a text so I could something like this:
I guess you don’t really mean the duration of a routine (since that is just determined by the duration of the components within it), but the duration of multiple presentations of a routine within a loop (i.e. where each presentation of a routine is much less than ten minutes, but you want to limit the total number of presentations)?
If so, see this:
and then you could have code that looks something like this:
if your_clock_name.getTime() >= 600:
continueRoutine = False
your_loop_name.finished = True
If that code is in the “each frame” tab of a code component, then it would end the routine and the loop at exactly ten minutes. If it is in the “begin routine” or “end routine” tabs, then it wouldn’t be as accurate (because the last routine might run past ten minutes), but the routine wouldn’t end part way through.
Thank you for responding and sorry for, once again, not providing enough detail!
The problem is I am programming a psychomotor vigilance task and I have to reset the clock every trial because I am using it as a counter for each trial. As in, each trial consists in the presentation of the counter until the participant responds, once he does, he gets feedback, i.e. how long he took to stop the stopwatch. So I unfortunately cannot continue to use the clock until it reaches 10 minutes (I think).