BIS fnc codePerformance: Difference between revisions
| m (Text replacement - "|Game version=" to "|Game version=  |gr1 = Debug |GROUP1=") | m (Text replacement - "|gr1 = Debug |GROUP1=" to "|gr1 = Diagnostic |GROUP1=") | ||
| Line 6: | Line 6: | ||
| |0.50|Game version= | |0.50|Game version= | ||
| |gr1 =  | |gr1 = Diagnostic |GROUP1= | ||
| ____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
Revision as of 16:02, 11 October 2020
Description
- Description:
- Measures how much time it takes to execute given expression. Results may vary based on overall performance; use this function to compare alternative scripting approaches rather than to measure specific values. Upon function execution, window with results is opened. The user then has a choice to copy the result into clipboard or not. 
 This function is using diag_codePerformance command. Keep in mind that this takes string, and that you can't pass
 str _codeas string because that add's curly braces to the string.
- Execution:
- call
- Groups:
- Diagnostic
Syntax
- Syntax:
- [expression, arguments, cycles, display] call BIS_fnc_codePerformance
- Parameters:
- expression: String - Tested expression
- arguments (Optional): Anything - Arguments to pass into the code. Default: []
- cycles (Optional): Number - Number of wanted cycles. Default: 10000
- display (Optional): Display - Display in which the message window with results will be opened. Use displayNull to disable the window. Default: Current mission display
- Return Value:
- Number - Average execution time of the expression
Examples
- Example 1:
- testArray = []; ["testArray = testArray + [1]"] call BIS_fnc_codePerformance; testArray = []; ["testArray set [count testArray, 1]"] call BIS_fnc_codePerformance; testArray = []; ["testArray pushBack 1"] call BIS_fnc_codePerformance;Compare three methods of adding elements into array
Additional Information
- See also:
- diag_codePerformance
Notes
- 
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
 Only post proven facts here! Add Note
 
	
