Jump to content

similar to sleep()


rfox

Recommended Posts

I basically have text displayed on the screen saying

 

processing . . .

 

Would be cool if I could say

 

processing *pause 1 second* .*pause 1 second* .*pause 1 second* .

 

<?php sleep(1) ?>. <?php sleep(1) ?>. <?php sleep(1) ?>.

 

I thought would display a . then wait 1 second. Rather then that, it simple doesn't display anything for 3 seconds, then everything is shoved on the screen at once.

 

How do I get that to work  ???

Link to comment
https://forums.phpfreaks.com/topic/44434-similar-to-sleep/
Share on other sites

hey pcbytes, thanks, but not quite.

 

It times the first dot, and the last 2 dots up come at the same time, so it just looks like a laggy website haha.

 

Also, while its printing out the dots, it doesn't load the rest of the site. So you cant see the bottom half of the website (All the code past the print dot)

 

I was looking at w3schools, but I could do with some help with javascript if possible, I am very... VERY bad @ javascript.. help would be awsome!

 

<script type="text/javascript">

var i=0

 

function timer(){

while (i<=3){

var t=setTimeout("document.write(' .')", 1000)

i=i+1

}

}

</script>

Link to comment
https://forums.phpfreaks.com/topic/44434-similar-to-sleep/#findComment-215837
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.