{"name":"BIS_fnc_deltaTime","title":"BIS fnc deltaTime","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_deltaTime","revid":364505,"updated":"2024-05-16T20:42:05Z","groups":["Math","Diagnostic"],"status":"ok","games":{"arma3":"1.00"},"since":"arma3 1.00","arma3_since":"1.00","description":"Calculates and returns the time's delta between previous and current call to this function.\n\n> [!NOTE]\n> This commands internally uses time. For accurate-critical time measurement, use diag_tickTime.","syntaxes":[{"syntax":"[id, clear] call BIS_fnc_deltaTime","params":[{"name":"id","type":"String","optional":true,"default":"\"generic\"","description":"used to not create conflicts between different systems calling this function, each system can calculate delta time since it last ticked. Will be a missionNamespace variable","type_expr":"String","text":"id: String - (Optional, default \"generic\") used to not create conflicts between different systems calling this function, each system can calculate delta time since it last ticked. Will be a missionNamespace variable"},{"name":"clear","type":"Boolean","optional":true,"default":"false","description":"if set to true, will delete the missionNamespace variable (defined by *id*)","type_expr":"Boolean","text":"clear: Boolean - (Optional, default false) if set to true, will delete the missionNamespace variable (defined by *id*)"}],"returns":{"type":"Number","type_expr":"Number","description":"the delta time - 0.001 if clear is true","text":"Number - the delta time - 0.001 if *clear* is true"}}],"examples":[{"code":["[\"TAG_duration\"] call BIS_fnc_deltaTime; // Defines the starting point\n// ...\nprivate _duration1 = [\"TAG_duration\"] call BIS_fnc_deltaTime; // Gets time between starting point and now\n// ...\nprivate _duration2 = [\"TAG_duration\"] call BIS_fnc_deltaTime; // Gets time between _duration1 and now\n[\"TAG_duration\", true] call BIS_fnc_deltaTime; // deletes the global variable \"TAG_duration\""]}],"see_also":["diag_tickTime","diag_deltaTime"]}