Lingo Dictionary > T-Z > timer

 

timer

Syntax

the timer

Description

System property; a free running timer that counts time in ticks (1 tick = 1/60 second). It has nothing to do with the timeoutScript property. It is used only for convenience in timing certain events. The startTimer command sets timer to 0.

The timer property is useful for determining the amount of time passed since the startTimer command was issued. For example, you can use timer to synchronize pictures with a soundtrack by inserting a delay that makes the movie wait until a certain amount of time has elapsed.

Example

This behavior for a frame script creates a 2-second delay:

on beginSprite
	startTimer
end
on exitFrame
	if (the timer < 60 * 2) then go the frame
end

Example

This statement sets the variable startTicks to the current timer value:

startTicks = the timer

See also

lastClick(), lastEvent(), lastKey, lastRoll, startTimer