# EventSequence

> Derives chronology from the complete capture before filtering, sorting, or pagination.

[API reference](/docs/api/index.md) › [Debug Core](/docs/extensions/debug-core/reference/index.md) › [Panel](/docs/extensions/debug-core/reference/panel/index.md) › [Event](/docs/extensions/debug-core/reference/panel/event/index.md) › EventSequence

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

Derives chronology from the complete capture before filtering, sorting, or pagination.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`__construct()`](#method-__construct) | Derives the chronology from the complete capture. | `EventSequence` |
| [`elapsed()`](#method-elapsed) | Returns how long after the first captured event the given row fired. | `EventSequence` |
| [`gap()`](#method-gap) | Returns the idle time between the given row and the one observed before it. | `EventSequence` |
| [`index()`](#method-index) | Returns the original observation position of the given row. | `EventSequence` |
| [`interval()`](#method-interval) | Returns only unambiguous, explicitly correlated inclusive intervals. | `EventSequence` |

## Method details

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

```php
public function __construct(list<PHPForge\Debug\Panel\Event\EventRow> $rows)
```

Derives the chronology from the complete capture.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$rows` | `list<`[`EventRow`](/docs/extensions/debug-core/reference/panel/event/eventrow/index.md)`>` | Original observation order. |

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

```php
public function elapsed(PHPForge\Debug\Panel\Event\EventRow $row): float
```

Returns how long after the first captured event the given row fired.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$row` | [`EventRow`](/docs/extensions/debug-core/reference/panel/event/eventrow/index.md) | Row to measure. |

**Returns**

`float`: Offset from the first captured row, in milliseconds.

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

```php
public function gap(PHPForge\Debug\Panel\Event\EventRow $row): float|null
```

Returns the idle time between the given row and the one observed before it.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$row` | [`EventRow`](/docs/extensions/debug-core/reference/panel/event/eventrow/index.md) | Row to measure. |

**Returns**

`float|null`: Milliseconds since the previous row, or `null` for the first row and for unknown rows.

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

```php
public function index(PHPForge\Debug\Panel\Event\EventRow $row): int
```

Returns the original observation position of the given row.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$row` | [`EventRow`](/docs/extensions/debug-core/reference/panel/event/eventrow/index.md) | Row to locate. |

**Returns**

`int`: One-based capture position, or `0` when the row is not part of the capture.

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

```php
public function interval(PHPForge\Debug\Panel\Event\EventRow $row): float|null
```

Returns only unambiguous, explicitly correlated inclusive intervals.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$row` | [`EventRow`](/docs/extensions/debug-core/reference/panel/event/eventrow/index.md) | Lifecycle `enter` marker to measure. |

**Returns**

`float|null`: Inclusive duration in milliseconds, or `null` when the correlation is absent or ambiguous.