{"name":"BIS_fnc_deltaTime","operator":null,"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","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.00"}],"since":{"game":"arma3","name":"Arma 3","version":"1.00"},"arma3_since":"1.00","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"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","since":null,"effect":null,"exec":null,"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","types":["String"],"since":null,"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*)","types":["Boolean"],"since":null,"text":"clear: Boolean - (Optional, default false) if set to true, will delete the missionNamespace variable (defined by *id*)"}],"returns":{"type":"Number","types":["Number"],"description":"the delta time - 0.001 if clear is true","text":"Number - the delta time - 0.001 if *clear* is true"}}],"examples":[{"text":"```sqf\n[\"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\"\n```","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\""]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["diag_tickTime","diag_deltaTime"],"notes":[],"categories":["Arma 3: Functions","Arma 3: New Functions","Function Group: Diagnostic","Function Group: Math","Functions","Introduced with Arma 3 version 1.00"],"docblock":null,"filled_from_docblock":[]}