settimeout javascript
snippet in javascript

settimeout javascript

Noob codes official

// program to display time every 3 seconds
function showTime() {

    // return new date and time
    let dateTime= new Date();

    // returns the current local time
    let time = dateTime.toLocaleTimeString();

    console.log(time)

    // display the time after 3 seconds
     setTimeout(showTime, 3000);
}

// calling the function
showTime();

settimeout jquery

user5986


 setTimeout(function(){ alert("Hello"); }, 3000);
 

javascript settimeout

user1051

setTimeout(function(){
 	alert("Sup!"); 
}, 2000);//wait 2 seconds

timeout javascript

user8238

setTimeout(function(){
 	//code goes here
}, 2000); //Time before execution

settimeout js

user7655


 setTimeout(function(){ alert("Hello"); }, 3000);

 //1000ms = 1 second

jquery settimeout

user3959

setTimeout(function(){ alert("Hello"); }, 3000);

settimeout javascript

user2086

setTimeout(function(){
 	console.log("hello");
}, 3000); //wait for atleast  3 seconds before console logging

settimeout javascript

Noob codes official

// program to display a text using setTimeout method
function greet() {
    console.log('Hello world');
}

setTimeout(greet, 3000);
console.log('This message is shown first');