How to sleep and unsleep loop for a 2 second in PHP

To stop the loop for a 2 seconds and run it again after 2 seconds, please use the below code

<?php
for($i=1;$i<50;$i++){

  if($i%10 == 0){

    sleep(2);
    usleep(40);
   }
   echo $i.date("h:i:sa")."<br>";
}
?>

How to sleep and unsleep loop for a 2 second in PHPexpoundsofttechsolution

ghb