Php time timer

Source: Internet
Author: User
Tags sleep function
For the php time timer, please help me. how does php get the time timer, that is, execute the program at intervals ?, PHP doesn't seem to exist. it should be in JS or in linux/unix !, Use sleep () to set the interval and run the program as a command line ., The simplest way is to judge the php time timer in the code.
Please help me. how can I get a time timer for php? that is to say, I want to execute the program at intervals?

------ Solution --------------------
PHP doesn't seem to have any,
It should be in JS or in linux/unix!
------ Solution --------------------
Use sleep () to set the interval and run the program as a command line.
------ Solution --------------------
The simplest way is to judge the time in the code and run it at that time. For static pages, you can use javascript src = 'XXX. php' to start them. The premise is that a visitor cannot run without a visitor.
------ Solution --------------------
You can write a scheduled task, but you can run Windows linux, and then decide at what time.
------ Solution --------------------
1. you can use for and add a sleep
2. or make a scheduled task in win.
------ Solution --------------------
Find out the web principles before posting.
------ Solution --------------------
Well, use the sleep function .~~~~~~~~
------ Solution --------------------
This is a very unrealistic problem. Or ajax or system scheduled tasks. Sleep makes PHP always have a process, and it feels uncomfortable.
------ Solution --------------------
Cronjob
------ Solution --------------------
It is best to do this in windows or linux.
If it is a rented host, it cannot be done.
------ Solution --------------------
PHP
Look at commet technology
Loop + sleep ()

JS
SeTimeout ();

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.