Delay | SoloLearn: Learn to code for FREE!

+2

Delay

How can I make a delay in js?

1/15/2017 1:05:45 PM

tim wong

1 Answer

New Answer

+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...