# Trial timing structure

Some infant testing procedures have a set time per trial (e.g., play this stimulus for 4 seconds, or play this sound file until it ends); for others, trial lengths depend on the child's looking behavior, requiring that the experimenter code behavior while the experiment is running. BITTSy allows individual stimuli to either [play for a set amount of time](https://ldevumd.gitbook.io/bittsy/creating-protocols/step-terminating-conditions#time), or to play until an event occurs (such as [looking away for a certain amount of time](https://ldevumd.gitbook.io/bittsy/creating-protocols/step-terminating-conditions#looking-based-conditions)), or for a [combination](https://ldevumd.gitbook.io/bittsy/creating-protocols/step-terminating-conditions#using-multiple-terminating-conditions) of these  (e.g., until a child looks away for X seconds, or until the file ends, whichever comes first). It also allows different trials to continue to occur for a [set number of trials](https://ldevumd.gitbook.io/bittsy/creating-protocols/loops#times-looped), or [until a certain threshold](https://ldevumd.gitbook.io/bittsy/creating-protocols/loops#looking-controlled-end-conditions) is reached (e.g., in habituation-based studies, or in training studies). Thus, an experiment might be set up to continue presenting the stimulus within a given trial until the child looks away for 2 seconds, but then to continue playing trials until some cumulative amount of looking has occurred.   All of these timing constraints can be set up as part of the protocol file.
