{"name":"diag_captureSlowFrame","title":"diag captureSlowFrame","type":"command","url":"https://community.bistudio.com/wiki/diag_captureSlowFrame","revid":370412,"updated":"2024-12-05T18:30:13Z","groups":["Diagnostic","Performance Profiling"],"status":"ok","games":{"arma2oa":"1.63","tkoh":"1.00","arma3":"1.00"},"since":"arma2oa 1.63","arma3_since":"1.00","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.\nThe 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.\nThe GUI also provides method of copying of the displayed data to clipboard.\n\n> [!NOTE]\n> **Chrome export format**:\n>\n> Capturing to file also creates a .trace file, which can be imported into chrome://tracing (in chromium based webbrowsers), or https://ui.perfetto.dev/\n>\n> 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.","syntaxes":[{"syntax":"diag_captureSlowFrame [section, threshold, frameSkip, toFile, continuousCounter]","params":[{"name":"section","type":"String","description":"**case-sensitive**; some of the selections:\n\n| Render | Main Thread | Visualize | Mjob |\n|---|---|---|---|\n| - bgD3D | - total<br>- sLoop (for dedicated server)<br>- cLoop (for headless client)<br>- memAl | - visul | - Mjob |","type_expr":"String"},{"name":"threshold","type":"Number or Arma 3 v2.20 String","description":"Number or Arma 3 v2.20 String\n\n- Number: 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.\n- String: 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)\n\n  > [!IMPORTANT]\n  > The capture happens \"when the section/scope duration is larger/longer than this\", except with \"fps\" where it is \"when smaller/lower\".","type_expr":"Number | String","text":"threshold: Number or Arma 3 v2.20 String\n\n- Number: 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.\n- String: 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)\n\n  > [!IMPORTANT]\n  > The capture happens \"when the section/scope duration is larger/longer than this\", except with \"fps\" where it is \"when smaller/lower\"."},{"name":"frameSkip","type":"Number","optional":true,"default":"0","description":"number of frames to ignore before measuring","type_expr":"Number","since":"arma3 1.18","text":"frameSkip: Number - (Optional, default 0) number of frames to ignore before measuring"},{"name":"toFile","type":"Boolean","optional":true,"default":"false","description":"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","type_expr":"Boolean","since":"arma3 2.20","text":"toFile: Boolean - (Optional, default false) 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"},{"name":"continuousCounter","type":"Number","optional":true,"default":"0","description":"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 or another diag_captureSlowFrame usage","type_expr":"Number","since":"arma3 2.20","text":"continuousCounter: Number - (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 or another diag_captureSlowFrame usage"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"unary","right":{"text":"[section, threshold, frameSkip, toFile, continuousCounter]"}}],"examples":[{"code":["diag_captureSlowFrame [\"total\", 0.003];"]},{"code":["diag_captureSlowFrame [\"total\", \"0.003s\"];"]},{"code":["diag_captureSlowFrame [\"total\", \"3ms\"];"]},{"code":["diag_captureSlowFrame [\"total\", \"333fps\"];"]},{"code":["diag_captureSlowFrame [\"memAl\", 0.0001, 30];"]},{"code":["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","diag_captureFrame","diag logSlowFrame","logEntities","exportJIPMessages"]}