> ## Documentation Index
> Fetch the complete documentation index at: https://www.adaline.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Latency

> Measure and evaluate response time to ensure your prompts meet performance requirements

The Latency evaluator measures the round-trip time from Adaline to the LLM provider. Use it to enforce SLA requirements, compare performance across models, and identify prompts that are too slow for your use case.

## Set up the Latency evaluator

**1. Open Evaluate from your prompt**

Open the prompt you want to test and click **Evaluate** in the prompt header.

![Opening the Evaluate tab from a prompt](https://mintcdn.com/adaline/6qZ1-Sm8NeEttI_w/images/evaluate/open-evaluate-tab.png?fit=max\&auto=format\&n=6qZ1-Sm8NeEttI_w\&q=85\&s=8a70c493b8cafd7a141b0220eff30640)

**2. Select the evaluator**

Add the Latency evaluator from the evaluator menu.

![Adding the Latency evaluator](https://mintcdn.com/adaline/6qZ1-Sm8NeEttI_w/images/evaluate/add-latency-evaluator.png?fit=max\&auto=format\&n=6qZ1-Sm8NeEttI_w\&q=85\&s=e3d8b2ef285ece1e9d16c832542dc100)

**3. Configure the threshold**

Give the evaluator a name, link a dataset, and set the latency threshold.

![Setting the latency threshold](https://mintcdn.com/adaline/Um_T8BffW4hfcoYD/images/evaluate/latency-threshold.png?fit=max\&auto=format\&n=Um_T8BffW4hfcoYD\&q=85\&s=e03ff063f71bda21777c89805c01c26d)

Choose from the following threshold operators:

| Operator | Behavior |
| - | - |
| **less than** | The response passes if it completes faster than your threshold. Use this to enforce maximum response time. |
| **greater than** | The response passes if it takes longer than your threshold. Use this to flag suspiciously fast (potentially incomplete) responses. |
| **equal to** | The response passes if it matches your exact timing requirement. |

**4. Select the unit of measure**

Choose the time unit for your threshold.

![Selecting the unit of measure](https://mintcdn.com/adaline/Um_T8BffW4hfcoYD/images/evaluate/response-speed-unit-measure.png?fit=max\&auto=format\&n=Um_T8BffW4hfcoYD\&q=85\&s=ec9d7192e727e1ceb57733d6e3681327)

**5. Run the evaluation**

Click **Evaluate** to execute the evaluation and see the results.

![Latency evaluator results](https://mintcdn.com/adaline/Um_T8BffW4hfcoYD/images/evaluate/latency-results.png?fit=max\&auto=format\&n=Um_T8BffW4hfcoYD\&q=85\&s=732df7c19bcd2d43beebf33bb509f5aa)

> [!NOTE]
>
> **Prompt chaining**: When your prompt uses [prompt variables](https://www.adaline.ai/docs/iterate/use-other-prompts-in-prompt.md) (child prompts), latency is calculated based on the **slowest execution at each level** of the chain. Prompts at the same depth execute in parallel, and the total latency is the sum of the maximum latencies from each level. For example, if Prompt A calls Prompts B and C in parallel (level 1), and Prompt C calls Prompts D and E in parallel (level 2), the total latency is: `max(B, C) + max(D, E) + A's own latency`.

## When to use

* **SLA enforcement** — Set maximum response time thresholds for production-facing prompts.
* **Model comparison** — Compare response speeds across different models handling the same test cases.
* **Performance optimization** — Identify slow-performing prompts and optimize for speed (shorter prompts, fewer tokens, faster models).
* **User experience** — Ensure response times are acceptable for interactive applications.

## Next steps

> [card] [Cost Evaluator](https://www.adaline.ai/docs/evaluate/cost.md)
>
> Track costs alongside latency.

> [card] [Response Length](https://www.adaline.ai/docs/evaluate/response-length.md)
>
> Control output size to improve latency.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.