Home >Web Front-end >JS Tutorial >The difference between javascript setTimeout and setInterval_Basic knowledge
The setTimeout method is a timing program, that is, what to do after a certain time. Pull it down when you're done.
The setInterval method means to repeatedly perform an operation at a certain interval.
If you use setTimeout to implement the function of setInerval, you need to call yourself regularly in the executing program. If you want to clear the counter, you need to call different clearing methods according to the method used:
For example:
tttt=setTimeout('northsnow()',1000);
clearTimeout(tttt);
Or:
tttt=setInterval('northsnow()',1000);
clearInteval(tttt);
For example: