-1
for(i=0;i<10;i++) {
//codes
sleep(500);
}

This code working finely with php , how to write this code with js ? help me please

user3393795
  • 89
  • 2
  • 9

1 Answers1

0

You'll have to use the setTimeOut() function. Here's how the basic usage goes :

setTimeOut(function(){ /*Your code */},500);

Also note that the time is in milliseconds. Here are some more examples to help you.

Dhruv Ramani
  • 2,633
  • 2
  • 22
  • 29