This article applies to:
This sample illustrates how to run trials for a specific amount of time (e.g., run as many trials as possible in 5 seconds).
The start time (lnStartTime) is determined before the 'TrialList' List object begins to run trials, and the end time (lnEndTime) is set to a defined amount of time (i.e., 30 seconds after the start time). While the trials are running, script is used to determine if the block should be terminated. If the current time is greater than or equal to the specified end time, the script jumps to the end of the current trial, and the 'TrialList' object is terminated, ending the trials.
NOTE: 'TrialList' is set to a large number of trials. Only the number of trials that can be run within the allotted time will take place.