Delay | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 2

Delay

How can I make a delay in js?

15th Jan 2017, 1:05 PM
tim wong
tim wong - avatar
1 Respuesta
+ 3
function func() { /* function body */ } var delay = 2500; // millisecondes window.setTimeout( func, delay ); /* rest of code running without waiting execution of 'func' */ If you need to WAIT instead DELAY, you must handle a way to simulate an end event for your function...
15th Jan 2017, 1:19 PM
visph
visph - avatar