Not sure if Windows has anything built in, but I found this: [cronw.sourceforge.net...]
mrho888
2:58 pm on Apr 10, 2010 (gmt 0)
What is it
astupidname
5:15 pm on Apr 11, 2010 (gmt 0)
What is it
What Readie has pointed you to is known as Cron Jobs, which may be run on servers at specific intervals or time frames. Actual manner of implementation can vary a bit from host to host however. It is unclear from your request whether this is what you actually intended as your need or not. Although you do say 'endlessly'..., do you really mean endlessly or for the duration of a user's viewing of a page? What needs to run every 5 seconds? Every 5 seconds on the server-side only? That is what cron is for. A few things will need to be taken in to consideration perhaps. One being hosting. Not all hosting plans have cron jobs available, though usually available for a small upgrade to better hosting plan. Check your control panel for 'Cron Jobs' or 'Scheduled Tasks'. And not all hosts allow cron jobs to run at that frequency of 5 seconds, I recently ran in to that issue with a host in the U.K. that does not allow greater frequency than every 1 hours, so you may have to work with what's available. Some hosts also limit the number of cron jobs that may be run, some don't.
By the way, welcome to webmasterworld!
jatar_k
3:32 pm on Apr 12, 2010 (gmt 0)
there is a way to sleep a script but you are still subject to max_execution_time in php.ini
every 5 secs is an awful lot, it better be a fast scipt that doesn't do much because if it goes over 5 secs you may have some trouble when it starts running more than once at the same time.
I have used ghetto cron too, embedding it in a page and using a db table to test for timing.
it all depends on what exactly you are trying to do. Most things don't need to run at such a low interval, sounds like trying to mimic real time.
Demaestro
3:45 pm on Apr 12, 2010 (gmt 0)
If you are going to run it every 5 seconds one thing to make sure of is that it will be done running after 5 seconds.
Usually you don't want a script to start again if the last time it ran hasn't completed.
You can set a global flag somewhere and unset it when the script is done running. Then before you run the script check the flag to see if it is running. If it is then wait another 5 seconds.
mrho888
1:53 pm on Apr 13, 2010 (gmt 0)
I am a new user. I still can't understand what you are talking. I am going to use Javascript to refresh the webpage. Can you give some comments on this idea?
Readie
1:58 pm on Apr 13, 2010 (gmt 0)
If you just want to refresh the page, you don't need javascript.