timer class : timer(class,string,int) fitter
Returns a new instance of timer class.
new timer(class handleInstance, string signature, int interval)
|user-defined class||handleInstance||An instance of a user-defined class.|
|timer||A new instance of timer class.|
Suppose you have the following class definition.
open method void THandler(dictionary dic)
... // timer handler code.
Usage of the timer(class,string,int) fitter is as follows.
timer tim = new timer(h, "THandler(dictionary)", 1000);
A returned instance has been initialized.
First argument: Specifies an instance of the class that has a handler as a member.
Second argument: Specifies the handler signature.
Third argument: Specify a number that is greater than 0 and less than or equal to the maximum int.
The unit is milliseconds.
The signature is the information for the timer to call the handler. It is a string that concatenates the handler method name and arguments.
The handler must be an open method with one argument of the dictionary class. If the method name of the handler is "handlerName", the definition of the handler is as follows.
Links for reference