Back to Browse

JavaScript setTimeout and setInterval: Difference between setTimeout and setInterval Methods

3.3K views
Nov 4, 2014
9:43

https://www.udemy.com/practical-javascript-javascript-basics/?couponCode=YouCust JavaScript setTimeout and setInterval: Difference between setTimeout and setInterval Methods Both setTimeout and setInterval methods are timer methods with the same syntax. The setTimeout method is used to execute a function after a specific delay and the setInterval method is used to execute a function repeatedly at specified intervals. In this video, we update a slider using setInterval and setTimeout methods. You could find that the setInterval method updates the slider at specified intervals whereas the setTimeout method updates the position of the slider just once after the specified delay. Once the timer is of no use, then you should clear the timer using clearInterval method in case of setInterval method and using clearTimeout method in case of clearTimeout method. To see how to use the setInterval method to create a clock, see this video: http://youtu.be/PPH1qWyYook

Download

1 formats

Video Formats

360pmp411.4 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

JavaScript setTimeout and setInterval: Difference between setTimeout and setInterval Methods | NatokHD