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

# block • AI Agents Framework

> block: Context manager for profiling a block of code.

# block

Method

> This is a method of the [**ProfilerCompat**](https://praison.ai/docs/sdk/reference/praisonai/classes/ProfilerCompat.md) class in the [**profiler**](https://praison.ai/docs/sdk/reference/praisonai/modules/profiler.md) module.

Context manager for profiling a block of code.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def block(name: str, category: str) -> Any
```

## Parameters

**name** `str` *required*

No description available.

**category** `str` (default: 'block')

No description available.

### Returns

**Returns** `Any`

The result of the operation.

## Uses

* `block`
* `get_profiler`

## Used By

* [`ProfilerCompat.block`](../functions/ProfilerCompat-block)

## Source

> [card] [View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai/praisonai/profiler.py#L826)
>
> `praisonai/profiler.py` at line 826


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