table Timer.GetTimerInfo()
returns a table
boolean IsRunning
boolean IsPaused
number Interval
string CallbackFunction
Example Usage:
tblTimer = Timer.GetTimerInfo()
--if timer 2 is running, pause it
if tblTimer[2].IsRunnng then
Timer.Pause(2);
end
--if timer 1 is paused, Resume it.
if tblTimer[1].Paused then
Timer.Resume(1);
end
Timer.Pause(number Timer)
Pauses the
specified timer if it is running. Use -1 to pause all
running timers
returns nothing
Example:
--pause timer 10
Timer.Pause(10);
--pause all
running timers
Timer.Pause(-1)
Timer.Resume(number Timer)
Resumes a
previously paused timer. Use -1 to resume all paused
timers
returns nothing
Example:
--resume timer 4;
Timer.Resume(4);
--resume all
paused timers
Timer.Resume(-1)
Timer.StartTimer(number Timer, number Interval, string Callback)
Starts the specified timer at the given interval the callback
function will be fired
returns nothing
Example:
function MyTimerCallBack()
ctr = ctr + 1;
end
--start timer 0, at 1000 miliseconds
Timer.StartTimer(0, 1000, "MyTimerCallback");
Timer.StopTimer(number
Timer)
Stops
the specified timer. Use -1 to stop all running timers.
returns nothing
Example Usage:
--stop timer 0
Timer.StopTimer(0);
|