# ProfileTimings

> Pairs profile begin/end log tuples into per-block timings.

[API reference](/docs/api/index.md) › [Debug Core](/docs/extensions/debug-core/reference/index.md) › [Panel](/docs/extensions/debug-core/reference/panel/index.md) › [Profile](/docs/extensions/debug-core/reference/panel/profile/index.md) › ProfileTimings

| final class | `PHPForge\Debug\Panel\Profile\ProfileTimings` |
| --- | --- |
| Source | [`src/Panel/Profile/ProfileTimings.php`](https://github.com/php-forge/debug-core/blob/main/src/Panel/Profile/ProfileTimings.php#L28) |

Pairs profile begin/end log tuples into per-block timings.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`calculate()`](#method-calculate) static | Calculates the per-block timings from profile-level log tuples. | `ProfileTimings` |

## Method details

### calculate() <span id="method-calculate"></span>

```php
public static function calculate(list<PHPForge\Debug\Panel\Profile\LogTuple> $messages): list<PHPForge\Debug\Panel\Profile\ProfileTiming>
```

Calculates the per-block timings from profile-level log tuples.

Each tuple is `[token, level, category, timestamp, traces, memory]`; a begin marker is matched with the next end
marker carrying the same token, producing one timing entry ordered by the begin position.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$messages` | `list<PHPForge\Debug\Panel\Profile\LogTuple>` | Profile log tuples in capture order. |

**Returns**

`list<PHPForge\Debug\Panel\Profile\ProfileTiming>`: Timings ordered by their begin marker.