Arma 3 Scripting

Function in Math, Diagnostic

BIS_fnc_deltaTime

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

Description

Calculates and returns the time's delta between previous and current call to this function.

Note

This commands internally uses time. For accurate-critical time measurement, use diag_tickTime.

Syntax

[id, clear] call BIS_fnc_deltaTime

Parameters:

Returns: Number - the delta time - 0.001 if clear is true

Examples

Example 1

["TAG_duration"] call BIS_fnc_deltaTime; // Defines the starting point
// ...
private _duration1 = ["TAG_duration"] call BIS_fnc_deltaTime; // Gets time between starting point and now
// ...
private _duration2 = ["TAG_duration"] call BIS_fnc_deltaTime; // Gets time between _duration1 and now
["TAG_duration", true] call BIS_fnc_deltaTime; // deletes the global variable "TAG_duration"

See also

diag_tickTime · diag_deltaTime