It is very easy to execute some code after a specified time-interval, i.e. setting some time interval between the code. We can use the setTimeout function.
Here is the code:
The basic structure is setTimeout(function, time in ms)
Hope it helps. Thanks.