I am trying to learn the ob_start
, ob_flush
function and I found this code on internet
if (ob_get_level() == 0) ob_start();
for($i=0;$i<1000;$i++)
{
echo "$i<br />";
ob_flush();
flush();
usleep(30000);
// sleep(0.03);
}
I am trying to change the usleep()
function which is use with microseconds to sleep (seconds) but it doesn't work as the usleep()
.
Is there something wrong or difference between sleep()
and usleep()
?