The enhanced version of delayedtask can provide multi-threaded timing services. This class provides management of multi-threaded tasks. You can use exttaskmgr to create an instance of taskrunner, and you can also create Ext on your own. util. taskrunner instance.
VaR task = {run: function () {Ext. Fly ('Clock'). Update (NewDate (). Format ('G: I: s');}, Interval: 1000// (Unit: milliseconds)} Var runner =NewExt. util. taskrunner (); runner. Start (task );
Structure:
Taskrunner ([number interval])
Interval: an optional parameter. When creating a scheduled task, you can specify interval in milliseconds as the interval for executing the thread. If this parameter is not specified, the default value is 10 milliseconds.
Method:
Start a thread: Start ([object task]): Object
Task: an optional parameter. It is an object.
Returns the object of the execution thread.
Stop a thread: Stop ([object task]): Object
Stop an existing task and return the task object.
Stop all threads: stopall ();