Return an instance of the timer class that is initialized by the specified value.
new timer(class handleInstance, string signature, int interval)
|class||handleInstance||An instance of the user-defined class that has the handler.|
|string||signature||Signature of the handler that is defined in the handleInstance.|
|timer||A timer class instance that was initialized.|
Suppose you have the following class definition.
open fitter handle()
// any initialization code...
open method void timerHandler(timer t)
// any handling code....
Usage of the timer(class,string,int) fitter is as follows.
handle h = new handle();
timer t = new timer(h,"timerHandler(timer)", 1000);
The first argument is an instance of any user defined type. It must have the method that you want to run in the timer.
The second argument is a string that indicates the signature of the timer handler.
The timer handler must be open method, and must have a timer class argument.
The return value from a handler will allow any type. However, the return value is not used. I recommends that a handler do not return a value.
In other words, the handler should be have the following format.
open method handlerName(timer agumentName)
// Please do here the necessary processing.
If you want to specify this method in the second argument. It will specify as "handlerName(timer)".
The third argument is the specified time interval. This argument is int class. You should be specified in the milliseconds unit. Zero or less cannot be specified.
Links for reference