setTimeout( ) Method
The setTimeout() method sets a timer which executes a function or specified piece of code once after the timer expires. The function is only executed once. It returns a positive integer value which identifies the timer created by the call to setTimeout(); this value can be passed to clearTimeout() to cancel the timeout.
setTimeout (function, milliseconds, para1, para2);
Ex: – var timeoutID = setTimeout(show, 2000);
clearTimeout( ) Method
The clearTimeout() method cancels a timeout previously established by calling setTimeout(). The ID value returned by setTimeout() is used as the parameter for the clearTimeout() method.
Syntax: – clearTimeout (timeoutID);
Ex: – clearTimeout(timeoutID);
setInterval( ) Method
The setInterval() method repeatedly calls a function or executes a code snippet, with a fixed time delay between each call. It returns an interval ID that uniquely identifies the interval, so you can remove it later by calling clearInterval().
Syntax: – setInterval (function, milliseconds, para1, para2);
Ex: – var intervalID = setInterval(show, 2000);
clearInterval( ) Method
The clearInterval() method cancels a timed, repeating action that was previously established by a call to setInterval().
Syntax: – clearInterval (intervalID);
Ex: – clearInterval(intervalID);
- Git Error: Filename too long - May 15, 2023
- Oracle RAC: Script that duplicates a database using a physical standby RAC as source - May 15, 2023
- Protected: oracle-rac-fixes - May 11, 2023