Skip to main content

The "timer_get_speed" Function

Syntax#

timer_get_speed(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 speed multiplier for the timer running in the current or specified instance, where a value of 1 is real time. If the instance or timer does not exist, 0 will be returned instead.

Example#

var my_timer_speed = timer_get_speed("my_timer");
my_timer_speed += (3 - my_timer_speed)*0.25;
timer_set_speed("my_timer", my_timer_speed);