---
name: "BIS_fnc_deltaTime"
type: function
status: ok
groups: ["Math", "Diagnostic"]
arma3_since: "1.00"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_deltaTime
revid: 364505
updated: 2024-05-16T20:42:05Z
---

# BIS_fnc_deltaTime

*Function · Math, Diagnostic · Arma 3 v1.00*

## Description

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

> [!NOTE]
> This commands internally uses [time](../commands/time.md). For accurate-critical time measurement, use [diag_tickTime](../commands/diag_tickTime.md).

## Syntax

```sqf
[id, clear] call BIS_fnc_deltaTime
```

**Parameters:**

- `id`: [String](../topics/String.md) - (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](../commands/missionNamespace.md) variable
- `clear`: [Boolean](../topics/Boolean.md) - (Optional, default [false](../commands/false.md)) if set to [true](../commands/true.md), will delete the [missionNamespace](../commands/missionNamespace.md) variable (defined by *id*)

**Returns:** [Number](../topics/Number.md) - the delta time - 0.001 if *clear* is [true](../commands/true.md)

## Examples

### Example 1

```sqf
["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](../commands/diag_tickTime.md) · [diag_deltaTime](../commands/diag_deltaTime.md)

<sub>Source: [BI Community Wiki — BIS fnc deltaTime](https://community.bistudio.com/wiki/BIS_fnc_deltaTime) (revision 364505).</sub>
