Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7894107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:18:31+00:00 2026-06-03T07:18:31+00:00

I have a function that is supposed to be an infinite function, but when

  • 0

I have a function that is supposed to be an infinite function, but when I start it it keeps loading. in this case he keeps going around 70-79 seconds while I have specified 21 in set_time_limit.

When I start it doesn’t do anything and when those 75 seconds are done it suddenly display 8 times the date difference. all at once. I want it to display my text every 1 second and without lagging for 1 hour long
all my values below are lower then the numbers I said above because I thought that 1 second would maybe to fast but it still lags for 10 seconds

set_time_limit (21);
// 21 seconds until its done should become an hour later
// this was to test 
$x=1;
$startTime = time();
$timeout = 10;   //timeout in seconds
for ($i=0;;$i++)
{
   if(time() > $startTime + ($x * $timeout)) {

     $x++;
     $today=date('d-m-Y H:i:s');
     echo "it's now: ". $today . "</br>";
     $newyear = date('d-m-Y H:i:s', mktime(0, 0, 0, 01, 01, 2013));
     $difference=get_datediff_string($vandaag,$nieuwjaar); 
     // get_datediff_string() is defined somewhere below,
     // but wasn't worth to show it.
     echo "it is $difference untill newyear"; 

   }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T07:18:33+00:00Added an answer on June 3, 2026 at 7:18 am

    This is caused by implicit buffering. It might be on the server side (in which case just calling flush() after echo should fix it), or it might be on the browser (in which case you’re out of luck).

    This kind of script really should be a console program anyway, I really don’t see the point of what you’re doing in a browser context.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this function that is supposed to query the database every 4 seconds
I have this Java function that's supposed to convert the string s to title
I have this function that I wrote that is supposed to display notifications: function
I have the following function that is supposed to trigger anytime one of the
I have two functions that are supposed to encrypt and decrypt a string but
I have function Start() that is fired on ready. When I click on .ExampleClick
I have a function that is supposed to return a formatted string (hh:mm:sec.xxx) I
I have a function that is supposed to calculate the number of times a
I have a function that is supposed to split my array into smaller, evenly
I have a function that is supposed to take a variable number of arguments

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.