delay in javascript

51

Delay in javascript -

setTimeout(function () {

//to do..

}, 1000);

delay in javascript -

const syncWait = ms => {
    const end = Date.now() + ms
    while (Date.now() < end) continue
}

Comments

Submit
0 Comments