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 7587897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:47:22+00:00 2026-05-30T19:47:22+00:00

I have the following code inside a file (I’m running it directly via Terminal

  • 0

I have the following code inside a file (I’m running it directly via Terminal or I access the webpage, it makes no difference).

error_reporting(E_ALL ^ E_NOTICE);
ini_set('display_errors', true);
ini_set('max_execution_time', 1);
ini_set('memory_limit', '512M');
sleep(2);
echo ini_get('max_execution_time');

And it outputs 1. Should it not throw an error, saying that the execution time was excedeed?

From phpinfo() I get:

max_execution_time  1   55
memory_limit    512M    1024M
  • 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-05-30T19:47:23+00:00Added an answer on May 30, 2026 at 7:47 pm

    sleep() time does not count toward execution time because it is not executing any code while it is sleeping.

    Note:

    The set_time_limit() function and the configuration directive
    max_execution_time only affect the execution time of the script
    itself. Any time spent on activity that happens outside the execution
    of the script such as system calls using system(), stream operations,
    database queries, etc. is not included when determining the maximum
    time that the script has been running. This is not true on Windows
    where the measured time is real.

    This includes sleep(), as is mentioned several times in the comments for both sleep() and for set_time_limit(), e.g.

    riki151205-Jun-2007 05:29

    Please note that, under Linux, sleeping
    time is ignored, but under Windows, it counts as execution time.

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

Sidebar

Related Questions

Inside my aspx file, I have the following html code inside an repeater: <div
On zend framework inside my bootstrap file i have the following code: $frontController =
In a Symfony project, I have the following php code inside a YML file.
I have the following code inside a function that is reading in a file
Inside my template function I have the following code: TypeName myFunction() { TypeName result;
I have the following XAML code, which displays a picture (image inside borders) and
I have ASP.Net code similar to the following (this is inside a FIELDSET): <ol>
I have the following code inside a class. (It's coffeescript-- and it's for a
I have the following code that uses 'paste' and AWK script inside Perl. use
I have the following code inside the body of my index.php page: echo Begin

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.