1var delayInMilliseconds = 1000; //1 second
2
3setTimeout(function() {
4 //your code to be executed after 1 second
5}, delayInMilliseconds);
6
1setTimeout(function(){
2 console.log("hello");
3}, 3000); //wait for atleast 3 seconds before console logging
1//setTimeout having parameater
2//1. function
3//2. time in mili second
4//parm1 , parm2 ........
5setTimeout(function(){
6 console.log("DARK_AMMY");
7}, 2000);//wait 2 seconds
1setTimeout(function(){
2 //Insert code here. Here is an example using discord.js
3 message.channel.send("Waited 5 seconds before sending this message.");
4}, 5000); //Waits 5 seconds before executing the function/code.
5//Code by: @NickIsNotADev#3506 on Discord.