Jump to content

User:Iritscen/vector.js: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 16: Line 16:
});*/
});*/


function sleep(ms) {
var a = 1 + 3;
  return new Promise(resolve function (foo) {setTimeout(resolve, ms)});
var b;
}
console.log("Engaging hacky sleep function...");
 
setTimeout(function()
async function demo() {
{
  console.log('Taking a break...');
    b = a + 4;
  await sleep(2000);
}, (2 * 1000));
  console.log('Two second later');
console.log("Done.");
}
 
demo();