---
name: "diag_captureSlowFrame"
type: command
status: ok
groups: ["Diagnostic", "Performance Profiling"]
arma3_since: "1.00"
branch: "diag prof"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/diag_captureSlowFrame
revid: 370412
updated: 2024-12-05T18:30:13Z
---

# diag_captureSlowFrame

*Command · Diagnostic, Performance Profiling · Arma 3 v1.00 · introduced in Arma 2: Operation Arrowhead v1.63 · branch: diag prof*

## Description

Opens "capture frame" dialog if current frame exceeds set threshold in seconds. One can indicate to either capture duration of a specific profiling selection or the total duration of the frame.
The selection names can be obtained by expanding the profiling tree. Clicking on a tree item will highlight the item on the graph and vice versa.
The GUI also provides method of copying of the displayed data to clipboard.

> [!NOTE]
> **Chrome export format**:
> Capturing to file also creates a .trace file, which can be imported into chrome://tracing (in chromium based webbrowsers), or https://ui.perfetto.dev/
>
> The same format can be exported by pressing the "COPY ALL" button, in the capture frame UI, with <kbd>Ctrl</kbd> key being held down.

## Syntax

```sqf
diag_captureSlowFrame [section, threshold, frameSkip, toFile, continuousCounter]
```

**Parameters:**

- `section`: [String](../topics/String.md) - **case-sensitive**; some of the selections:

  | Render | Main Thread | Visualize | Mjob |
  |---|---|---|---|
  | - bgD3D | - total<br>- sLoop (for dedicated server)<br>- cLoop (for headless client)<br>- memAl | - visul | - Mjob |
- `threshold`: [Number](../topics/Number.md) or Arma 3 v2.20 [String](../topics/String.md)
  - [Number](../topics/Number.md): section duration in seconds. 0 captures always **IF** the section you gave as section filter appears inside the given frame. "total" always appears, while "callExt" might not always appear for example.
  - [String](../topics/String.md): number with unit (s / ms / us / ns / fps, e.g "30fps" - see [SI prefixes](https://en.wikipedia.org/wiki/Second#SI_multiples) for more unit information)

  > [!IMPORTANT]
  > The capture happens "when the section/scope duration is larger/longer than this", except with "fps" where it is "when smaller/lower".
- `frameSkip`: [Number](../topics/Number.md) - (Optional, default 0) number of frames to ignore before measuring *(since arma3 1.18)*
- `toFile`: [Boolean](../topics/Boolean.md) - (Optional, default [false](../commands/false.md)) if true, doesn't open UI and writes straight to file. If logging to file, it automatically also outputs a .trace file. Note: even if false it might still force to file if it doesn't have a UI, like a server or HC *(since arma3 2.20)*
- `continuousCounter`: [Number](../topics/Number.md) - (Optional, default 0) captures N slow frames. 0 or 1 will only capture one frame - do **not** set it to negative! Can be aborted by running [diag_captureFrame](../commands/diag_captureFrame.md) or another [diag_captureSlowFrame](../commands/diag_captureSlowFrame.md) usage *(since arma3 2.20)*

**Returns:** [Nothing](../topics/Nothing.md)

## Examples

### Example 1

```sqf
diag_captureSlowFrame ["total", 0.003];
```

### Example 2

```sqf
diag_captureSlowFrame ["total", "0.003s"];
```

### Example 3

```sqf
diag_captureSlowFrame ["total", "3ms"];
```

### Example 4

```sqf
diag_captureSlowFrame ["total", "333fps"];
```

### Example 5

```sqf
diag_captureSlowFrame ["memAl", 0.0001, 30];
```

### Example 6

```sqf
diag_captureSlowFrame ["total", 0, 0, false, 3]; // opens the capture UI three times
```

## See also

Arma 3: Diagnostics Exe · Performance Profiling · Arma 3: Cheats · Multiplayer Server Commands · [diag_captureFrameToFile](../commands/diag_captureFrameToFile.md) · [diag_captureFrame](../commands/diag_captureFrame.md) · diag logSlowFrame · [logEntities](../commands/logEntities.md) · [exportJIPMessages](../commands/exportJIPMessages.md)

<sub>Source: [BI Community Wiki — diag captureSlowFrame](https://community.bistudio.com/wiki/diag_captureSlowFrame) (revision 370412).</sub>
