1. Everytime (time interval, [timer name], function name, [limit of times], [Wait for function program complete])
2. Onetime (time interval, [timer name], call function)
3. StopTime ([timer name], [function name])
/*************************************************************
* Everytime (time interval, [timer name], function name, [limit of times], [wait function complete])
*************************************************************/
Execute function Test () every 1 seconds
function Test () {
Do something ...
}
$ (' body '). everytime (' 1s ', test);
Performed every 1 seconds
$ (' body '). everytime (' 1s ', function () {
Do something ...
});
Execute every 1 seconds and name the timer named a
$ (' body '). everytime (' 1s ', ' a ', function () {
Do something ...
});
Execute every 20 seconds, up to 5 times, and name the timer named B
$ (' body '). Everytime (' 2das ', ' B ', function () {
Do something ...
},5);
Execute every 20 seconds, infinite number of times, and name the timer named C
If the time interval arrives, but the function is still incomplete, wait for the execution function to complete before continuing the timer
$ (' body '). Everytime (' 2das ', ' C ', function () {
Execute a program that will last more than 20 seconds
},0,true);
/***********************************************************
* Onetime (time interval, [timer name], call function)
***********************************************************/
Minus 10 seconds to execute.
$ (' body '). Onetime (' 1das ', function () {
Do something ...
});
Execute after 100 seconds, and name the timer named D
$ (' body '). Onetime (' 1hs ', ' d ', function () {
Do something ...
});
/************************************************************
* STOPTIME ([timer name], [function name])
************************************************************/
Stop all the timers on the $ (' body ')
$ (' body '). StopTime ();
Stop the timer named a on $ (' body ')
$ (' body '). StopTime (' a ');
Stop timer for all call Test () on $ (' body ')
$ (' body '). StopTime (test);