Results 1 to 4 of 4

Thread: Maximum limit for setting a sleep time

  1. #1
    Join Date
    Apr 2009
    Posts
    105

    Maximum limit for setting a sleep time

    Hello Friends,

    I would like to know that what is the mamimum limit that can be used for setting the sleep time on my system. If i try to set the sleep time to 47secs, i get a warning message that "sleep time is too long". So, can any body tell me that what is the maximum limit that can be used for setting the sleep time on my system? Does any body knows about it? Kindly help me out to resolve the above issue.

    Thanks a lot.

  2. #2
    Join Date
    Jan 2008
    Posts
    3,388

    Re: Maximum limit for setting a sleep time

    I think the default PHP script execution time is set for 30 seconds at php.ini file. This is the time limit set for all the files to finish its execution. If the file takes more than this set time then the execution of the script will be stopped and error message will be displayed like this.

    Fatal error: Maximum execution time of 30 seconds exceeded in F:\php_files\t\test.php on line 14

  3. #3
    Join Date
    May 2008
    Posts
    4,085

    Re: Maximum limit for setting a sleep time

    If you are using a screen saver, you can adjust or even turn off the screen saver function. The Energy Saver preferences pane will display a ‘Screen Saver’ button whenever your display is set to go to sleep before your screen saver get activated.

  4. #4
    Join Date
    Apr 2008
    Posts
    3,267

    Re: Maximum limit for setting a sleep time

    This error occurs because by default the maximum execution time set at php.ini is 30 seconds. If you try to change the above code by adding just one line set_time_limit(60) in it, it will not show the error again. Here is the code by which you can set the mamimum limit on your system.

    set_time_limit ( 60 ) ;
    $t1=time();

    sleep(30);
    $t2=time();
    $t_lapsed=$t2-$t1;
    echo "Total time lapsed = $t_lapsed";
    Now the script will execute fine without any error message. We can see the total time taken by the script. We can set the time to unlimited value by making it to 0 value. Like this

    set_time_limit (0);

Similar Threads

  1. What is the maximum age limit for appearing in IAS?
    By --MasseySian-- in forum Education Career and Job Discussions
    Replies: 5
    Last Post: 06-09-2012, 07:02 PM
  2. what is the maximum RAM limit in Dell XPS 17 L702X
    By Rajkumari12 in forum Motherboard Processor & RAM
    Replies: 3
    Last Post: 23-05-2012, 04:31 PM
  3. What is the maximum RAM Limit for any Windows 64Bit system
    By Avipsa in forum Windows x64 Edition
    Replies: 2
    Last Post: 21-04-2012, 04:26 PM
  4. What is the maximum limit for TCP port connections on any computer
    By GeforceUser in forum Networking & Security
    Replies: 3
    Last Post: 01-08-2009, 12:11 AM
  5. Maximum limit for antispyware programs
    By Kamran in forum Networking & Security
    Replies: 3
    Last Post: 05-05-2009, 11:37 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,484,197.57221 seconds with 17 queries