{"name":"BIS_fnc_runLater","title":"BIS fnc runLater","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_runLater","revid":349313,"updated":"2023-11-08T14:52:25Z","groups":["Program Flow"],"status":"ok","games":{"arma3":"1.16"},"since":"arma3 1.16","arma3_since":"1.16","description":"Stack code/function that should be run later, after some time/frames or/and custom condition. Internally calls BIS_fnc_loop.","syntaxes":[{"syntax":"[id, code, timer, timerType, condition] call BIS_fnc_runLater","params":[{"name":"id","type":"String","description":"unique Id","type_expr":"String"},{"name":"code","type":"Code or String","description":"code/function that is executed later","type_expr":"Code | String"},{"name":"timer","type":"Number","description":"the timer value (can be in seconds or frames)","type_expr":"Number"},{"name":"timerType","type":"String","description":"can be \"seconds\" or \"frames\"","type_expr":"String"},{"name":"condition","type":"Code","description":"the custom condition, code is only executed if timer is validated and condition is met","type_expr":"Code"}],"returns":{"type":"Nothing","type_expr":"Nothing"}}],"examples":[{"code":["// Hints current game time in the next frame after 5 seconds have passed\n[\"uniqueId\", { hint str time; }, 5] call BIS_fnc_runLater;"]},{"code":["// Hints current game time in the next frame after 120 frames have passed\n[\"uniqueId\", { hint str time; }, 120, \"frames\"] call BIS_fnc_runLater;"]},{"code":["// Hints current game time in the next frame after BIS_variable is assigned\n[\"uniqueId\", { hint str time; }, nil, nil, { !isNil { BIS_variable } }] call BIS_fnc_runLater;"]},{"code":["// Hints current game time in the next frame after 5 seconds have passed and BIS_variable is assigned\n[\"uniqueId\", { hint str time; }, 5, \"seconds\", { !isNil { BIS_variable } }] call BIS_fnc_runLater;"]},{"code":["// Hints current game time in the next frame\n[\"uniqueId\", { hint str time; }] call BIS_fnc_runLater;"]}],"see_also":["BIS_fnc_CPWaitUntil","waitUntil","BIS_fnc_loop"]}