> For the complete documentation index, see [llms.txt](https://ldevumd.gitbook.io/bittsy/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ldevumd.gitbook.io/bittsy/bittsy-basics/trial-structure.md).

# 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](/bittsy/creating-protocols/step-terminating-conditions.md#time), or to play until an event occurs (such as [looking away for a certain amount of time](/bittsy/creating-protocols/step-terminating-conditions.md#looking-based-conditions)), or for a [combination](/bittsy/creating-protocols/step-terminating-conditions.md#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](/bittsy/creating-protocols/loops.md#times-looped), or [until a certain threshold](/bittsy/creating-protocols/loops.md#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.
