PHP Timer Edge output Edge Refresh page

Source: Internet
Author: User

When using the timer, of course, want to see the Web page output, do not want the page directly stuck, the end of the timer output.

To achieve the timer does not get stuck output, only need two functions on the line, look at the following code

<?PHP//Timer test code demo//Tracking Timer program timerpro.phpIgnore_user_abort(true); Set_time_limit(600);$interval= 10;$stop= 1;  Do {   if($stop= = 10)       Break; $curTime=Date(' Y-m-d h:i:s ', Time()); file_put_contents(' Timer.log ', ' Current time: '.$curTime.‘ Stop: '.$stop.Php_eol,file_append); Echo $stop." <br> "; $stop++; Ob_flush(); Flush(); Sleep($interval); }  while(true);?>
Ob_flush();     Flush  
Need the above two function pages will not get stuck, testing on Windows Chrome, indispensable.

 

PHP Timer Edge output Edge Refresh page

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.