Arma 3 Scripting

Command in Diagnostic, Performance Profiling

diag_codePerformance

Also available as Markdown and JSON, or read the original wiki page.

Description

Attempts to run given code with given arguments given number of cycles in unscheduled environment and returns average time it took to run the code as well as actual number of executions performed. The command will return as soon as possible if the tested code is slow and the duration of the command exceeds 1 second. Engine alternative to BIS_fnc_codePerformance.

Syntax

diag_codePerformance [code, arguments, cycles]

Parameters:

Returns: Array with [duration, cycles]

Examples

Example 1

private _result = diag_codePerformance [{ private _a = 123; }, 0, 10000];

Multiplayer

For security purposes, this command will only run for 1 cycle in multiplayer, unless in-game debug console is available via description.ext option or Eden attribute setting.

See also

diag_log · BIS_fnc_codePerformance · Code Optimisation