//A
setTimeout( () =>{
//C - 1 second later
}, 1000);
//B
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function demo() {
console.log('Taking a break for 2 seconds...');
await sleep(2000);
console.log('2 seconds later');
}
demo();
setTimeout(function () {
// ...
}, 10000);
// or
.then(() => {
// ...
({ timeout: 10000 });
});
setTimeout(function(){
2 console.log("Ready")
3}, 1000);