# 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ldevumd.gitbook.io/bittsy/bittsy-basics/trial-structure.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
