attendre javascript
wait(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
Graceful Guanaco
wait(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
setTimeout(() => { console.log("2000 milliseconds later!"); }, 2000);
function wait(ms)
{
var d = new Date();
var d2 = null;
do { d2 = new Date(); }
while(d2-d < ms);
}