---
name: "BIS_fnc_VRTimer"
type: function
status: ok
groups: ["VR"]
arma3_since: "1.00"
locality: {"argument": null, "effect": "local", "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_VRTimer
revid: 376474
updated: 2025-10-16T20:10:46Z
---

# BIS_fnc_VRTimer

*Function · VR · Arma 3 v1.00*

Locality: effect **local** · executed with **spawn**

## Description

Timer for VR and time trials. The following [missionNamespace](../commands/missionNamespace.md) variables can be used:
- `BIS_stopTimer`: set to [true](../commands/true.md) to stop the timer. Once stopped, the function must be executed again to restart the timer
- `RscFiringDrillTime_current`: fill with [Structured Text](../topics/Structured_Text.md) to display text instead of timer (when timer is stopped)
- `RscFiringDrillTime_done`: set to [true](../commands/true.md) to close the display. ***Stop the timer first***

## Syntax

```sqf
[colour] spawn BIS_fnc_VRTimer
```

**Parameters:**

- `colour`: [String](../topics/String.md) (Optional, default `(["IGUI", "WARNING_RGB"] call BIS_fnc_displayColorGet) call BIS_fnc_colorRGBtoHTML`) timer colour in HTML format (#RRGGBB)

**Returns:** [Nothing](../topics/Nothing.md)

## Examples

### Example 1

```sqf
[] spawn BIS_fnc_VRTimer;
```

### Example 2

```sqf
"#025D00" spawn BIS_fnc_VRTimer;
```

### Example 3

```sqf
["#025D00"] spawn BIS_fnc_VRTimer;
```

## See also

[BIS_fnc_displayColorGet](../functions/BIS_fnc_displayColorGet.md) · [BIS_fnc_colorRGBtoHTML](../functions/BIS_fnc_colorRGBtoHTML.md)

## Community notes

**Lou Montana** — 2018-06-04

Here is a countdown, inspired by this function:

```sqf
LM_fnc_timeoutCountdown = {

    params [
        ["_time", 30, [0]],
        ["_colour", "#FFFFFF", [""]]
    ];
    private _timeout = time + _time;
    RscFiringDrillTime_done = false;
    1 cutRsc ["RscFiringDrillTime", "PLAIN"];
    while { time < _timeout } do
    {
        private _remainingTime = _timeout - time;
        private _timeFormat = [_remainingTime, "MM:SS.MS", true] call BIS_fnc_secondsToString;
        private _text = format ["<t align='left' color='%1'><img image='%2' />%3:%4<t size='0.8'>.%5</t>",
            _colour,
            "A3\Modules_F_Beta\data\FiringDrills\timer_ca",
            _timeFormat select 0,
            _timeFormat select 1,
            _timeFormat select 2
        ];
        RscFiringDrillTime_current = parseText _text;
        sleep 0.01;
    };
    private _timeFormat = [0, "MM:SS.MS", true] call BIS_fnc_secondsToString;
    RscFiringDrillTime_current = parseText format ["<t align='left' color='%1'><img image='%2' />%3:%4<t size='0.8'>.%5</t>",
        _colour,
        "A3\Modules_F_Beta\data\FiringDrills\timer_ca",
        _timeFormat select 0,
        _timeFormat select 1,
        _timeFormat select 2];
    sleep 4;
    RscFiringDrillTime_done = true;
};
```

and to use it:

```sqf
[10, "#FF5500"] spawn LM_fnc_timeoutCountdown;
```

<sub>Source: [BI Community Wiki — BIS fnc VRTimer](https://community.bistudio.com/wiki/BIS_fnc_VRTimer) (revision 376474).</sub>
