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

# Import Profiler • AI Agents Framework

> ImportProfiler: Context manager to profile imports.

# ImportProfiler

> Defined in the [**profiler**](../modules/profiler) module.

<Badge color="purple">AI Agents Framework</Badge>

Context manager to profile imports.

## Methods

<CardGroup cols={2}>
  <Card title="get_imports()" icon="function" href="../functions/ImportProfiler-get_imports">
    Get recorded imports.
  </Card>

  <Card title="get_slowest()" icon="function" href="../functions/ImportProfiler-get_slowest">
    Get N slowest imports.
  </Card>
</CardGroup>

## Usage

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
with profile_imports() as profiler:
        import heavy_module
    
    print(profiler.get_imports())
```

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai/praisonai/profiler.py#L952">
  `praisonai/profiler.py` at line 952
</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>
