{"name":"diag_captureSlowFrame","operator":null,"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","replaced_by":[],"games":[{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.63"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"1.00"}],"since":{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.63"},"arma3_since":"1.00","branch":"diag prof","locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"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> 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]","since":null,"effect":null,"exec":null,"params":[{"name":"section","type":"String","optional":false,"default":null,"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 |","types":["String"],"since":null,"text":"section: String - **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 |"},{"name":"threshold","type":"Number or Arma 3 v2.20 String","optional":false,"default":null,"description":"Number or Arma 3 v2.20 String\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\".","types":["Number","String"],"since":null,"text":"threshold: Number or Arma 3 v2.20 String\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","types":["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","types":["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","types":["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","types":["Nothing"],"description":null,"text":"Nothing"},"form":"unary","operator":null,"left":null,"right":{"text":"[section, threshold, frameSkip, toFile, continuousCounter]","types":["Array"]}}],"examples":[{"text":"```sqf\ndiag_captureSlowFrame [\"total\", 0.003];\n```","code":["diag_captureSlowFrame [\"total\", 0.003];"]},{"text":"```sqf\ndiag_captureSlowFrame [\"total\", \"0.003s\"];\n```","code":["diag_captureSlowFrame [\"total\", \"0.003s\"];"]},{"text":"```sqf\ndiag_captureSlowFrame [\"total\", \"3ms\"];\n```","code":["diag_captureSlowFrame [\"total\", \"3ms\"];"]},{"text":"```sqf\ndiag_captureSlowFrame [\"total\", \"333fps\"];\n```","code":["diag_captureSlowFrame [\"total\", \"333fps\"];"]},{"text":"```sqf\ndiag_captureSlowFrame [\"memAl\", 0.0001, 30];\n```","code":["diag_captureSlowFrame [\"memAl\", 0.0001, 30];"]},{"text":"```sqf\ndiag_captureSlowFrame [\"total\", 0, 0, false, 3]; // opens the capture UI three times\n```","code":["diag_captureSlowFrame [\"total\", 0, 0, false, 3]; // opens the capture UI three times"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["Arma 3: Diagnostics Exe","Performance Profiling","Arma 3: Cheats","Multiplayer Server Commands","diag_captureFrameToFile","diag_captureFrame","diag logSlowFrame","logEntities","exportJIPMessages"],"notes":[],"categories":["Arma 2: Operation Arrowhead: New Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 3: Scripting Commands","Arma 3: Scripting Commands: Diagnostic Branch","Arma 3: Scripting Commands: Profiling Branch","Command Group: Diagnostic","Command Group: Performance Profiling","Introduced with Arma 2: Operation Arrowhead version 1.63","Scripting Commands","Take On Helicopters: Scripting Commands"]}