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

# Profile Lines • AI Agents Framework

> profile_lines: Decorator for line-level profiling.

# profile\_lines

<div className="flex items-center gap-2">
  <Badge color="teal">Function</Badge>
</div>

> This function is defined in the [**profiler**](../modules/profiler) module.

Decorator for line-level profiling.

Note: Requires line\_profiler package for full functionality.
Falls back to basic timing if not available.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def profile_lines(func: Optional[Callable]) -> Any
```

## Parameters

<ParamField query="func" type="Optional" required={false}>
  No description available.
</ParamField>

### Returns

<ResponseField name="Returns" type="Any">
  The result of the operation.
</ResponseField>

## Usage

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
@profile_lines
    def my_function():
        pass
```

## Uses

* `Profiler.is_enabled`
* `fn`
* `LineProfiler`
* `lp.add_function`
* `lp.enable`
* `lp.disable`
* `io.StringIO`
* `lp.print_stats`
* `Profiler.set_line_profile_data`
* `s.getvalue`

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai/praisonai/profiler.py#L1110">
  `praisonai/profiler.py` at line 1110
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Agent Profiles" icon="id-card" href="/docs/features/agent-profiles" />

  <Card title="Profiling" icon="chart-line" href="/docs/features/profiling" />
</CardGroup>
