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

<Steps>
  <Step title="Open Evaluate from your prompt">
    Open the prompt you want to test and click **Evaluate** in the prompt header.

    <img src="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" alt="Opening the Evaluate tab from a prompt" title="Opening the Evaluate tab from a prompt" style={{ width: "100%" }} width="3456" height="1839" data-path="images/evaluate/open-evaluate-tab.png" />
  </Step>

  <Step title="Select the evaluator">
    Add the Latency evaluator from the evaluator menu.

    <img src="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" alt="Adding the Latency evaluator" title="Adding the Latency evaluator" style={{ width: "100%" }} width="1275" height="776" data-path="images/evaluate/add-latency-evaluator.png" />
  </Step>

  <Step title="Configure the threshold">
    Give the evaluator a name, link a dataset, and set the latency threshold.

    <img src="https://mintcdn.com/adaline/Um_T8BffW4hfcoYD/images/evaluate/latency-threshold.png?fit=max&auto=format&n=Um_T8BffW4hfcoYD&q=85&s=e03ff063f71bda21777c89805c01c26d" alt="Setting the latency threshold" title="Setting the latency threshold" style={{ width: "100%" }} width="916" height="404" data-path="images/evaluate/latency-threshold.png" />

    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.                                                                   |
  </Step>

  <Step title="Select the unit of measure">
    Choose the time unit for your threshold.

    <img src="https://mintcdn.com/adaline/Um_T8BffW4hfcoYD/images/evaluate/response-speed-unit-measure.png?fit=max&auto=format&n=Um_T8BffW4hfcoYD&q=85&s=ec9d7192e727e1ceb57733d6e3681327" alt="Selecting the unit of measure" title="Selecting the unit of measure" style={{ width: "100%" }} width="1098" height="343" data-path="images/evaluate/response-speed-unit-measure.png" />
  </Step>

  <Step title="Run the evaluation">
    Click **Evaluate** to execute the evaluation and see the results.

    <img src="https://mintcdn.com/adaline/Um_T8BffW4hfcoYD/images/evaluate/latency-results.png?fit=max&auto=format&n=Um_T8BffW4hfcoYD&q=85&s=732df7c19bcd2d43beebf33bb509f5aa" alt="Latency evaluator results" title="Latency evaluator results" style={{ width: "100%" }} width="1028" height="585" data-path="images/evaluate/latency-results.png" />
  </Step>
</Steps>

<Note>
  **Prompt chaining**: When your prompt uses [prompt variables](/docs/iterate/use-other-prompts-in-prompt) (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`.
</Note>

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

<CardGroup cols={2}>
  <Card title="Cost Evaluator" icon="circle-dollar-sign" href="/docs/evaluate/cost">
    Track costs alongside latency.
  </Card>

  <Card title="Response Length" icon="ruler" href="/docs/evaluate/response-length">
    Control output size to improve latency.
  </Card>
</CardGroup>
