<?php
echo "<BR><BR>A) Present time is:<BR>";
echo date('h:i:s') . "\n<BR>Dela ying 5 seconds, new time is:<BR>";
sleep(5);
echo date('h:i:s') . "\n<BR>";
?>
This first script delays 5 seconds then prints everything.
How can we make it immediately print the present time,
tell us that there is a delay,and then print
the concluding delayed time after 5 seconds?
<?
echo "<BR><BR>B) Count the numbers to 6:<BR>";
for($k=1 ; $k<=6 ; $k++){
echo("$k<br />");
sleep(3);
}
?>
Similarly, this second script has a long delay
and then writes all the numbers at once.
How can we make it write the numbers one at a time
with a 3 second delay between them?
echo "<BR><BR>A) Present time is:<BR>";
echo date('h:i:s') . "\n<BR>Dela ying 5 seconds, new time is:<BR>";
sleep(5);
echo date('h:i:s') . "\n<BR>";
?>
This first script delays 5 seconds then prints everything.
How can we make it immediately print the present time,
tell us that there is a delay,and then print
the concluding delayed time after 5 seconds?
<?
echo "<BR><BR>B) Count the numbers to 6:<BR>";
for($k=1 ; $k<=6 ; $k++){
echo("$k<br />");
sleep(3);
}
?>
Similarly, this second script has a long delay
and then writes all the numbers at once.
How can we make it write the numbers one at a time
with a 3 second delay between them?
Comment