1var delayInMilliseconds = 1000; //1 second
2
3setTimeout(function() {
4 //your code to be executed after 1 second
5}, delayInMilliseconds);
6
1 $(this).delay(1000).queue(function() {
2
3 // your Code | Function here
4
5 $(this).dequeue();
6
7 });
1function sleep(ms) {
2 return new Promise(resolve => setTimeout(resolve, ms));
3}
4
5console.log("Hello");
6sleep(2000).then(() => { console.log("World!"); });
7