| Reference | Downloads | Github

Breaking an inner loop with temporal criteria breaks also outer loop

URL of experiment:

Description of the problem:
Hi, my experiment has nested loops. I have an inner loop that breaks after 30 seconds. Using the code trials.finished = true also breaks my outer loop and its repetitions. I Have seen that this problem has been solved when the loop breaks after nRep. I wasn’t able to implement it for my issue.

This is my code where “counting” is my inner loop

In the routine before the inner loop
Begin Routine
totalTime = 0;
timeLimit = 10;
incrementalClock = new util.Clock();

in the inner loop

Begin routine

if (((totalTime + incrementalClock.getTime())) >= timeLimit)
continueRoutine =false;


thank you for any suggestion!