Overview
Creates a timer event that calls user function after user-set time. Timer class inherits Object class.
Syntax
• time : (required) delay time in milli-second
• func : (required) callback function. After 'time' milli-seconds, func is called
• loops : (optional: default value is 1) repeating number.
if loops is INF, then func is periodically called forever
• onEnd : (optional) this function is called when 'func' is called 'loops' times.
Note: The timer object is removed automatically when the 'func' is called 'loops' times.
The func receives a table as a first argument containing the following fields
• count : number of calling func
• isFinal : true if this is the final call of func
• time : elapsed time in milli-second
댓글 없음:
댓글 쓰기