The "timer_get" Function

Syntax

timer_get(id, [instance]);
ArgumentTypeDescription
idstringThe unique timer ID to check, as a string
[instance]instanceOptional: Sets the object instance containing the timer to check (use none for self)

Description

Returns the time remaining for the timer running in the current or specified instance, as a value of seconds. If the instance or timer does not exist, -1 will be returned instead.

Example

var inst_streetlight = instance_find(obj_streetlight, 0);
var race_started = (timer_get("t_streetlight", inst_streetlight) == 0);