Lost Password?

Go Back   CodeCall Programming Forum > Web Development Forum > PHP Forum

Unregistered, Check out the Coder Battles in the Announcement and Game forums.

PHP Forum Use this forum to discuss all aspects of PHP Development. PHP is a server-side, cross-platform, HTML embedded scripting language that lets you create dynamic web pages.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-05-2007, 04:33 PM
smith smith is offline
Programmer
 
Join Date: Jun 2006
Posts: 108
Credits: 0
Rep Power: 9
smith is on a distinguished road
Default Execution Time

Does anyone know how to beat the Execution Time of PHP without editing the php.ini file? I'm developing a program that takes a long time to finish. Most users will only allow a minute or less of PHP execution time. How do I get around this?
__________________
Code:
for (int i;;) {
   cout << "Smith";
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 01-06-2007, 12:27 AM
John's Avatar   
John John is online now
Co-Administrator
 
Join Date: Jul 2006
Age: 20
Posts: 3,238
Last Blog:
Passwords
Credits: 887
Rep Power: 20
John has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud of
Send a message via AIM to John Send a message via MSN to John
Default

I couldn't imagine a script taking more than one minute to load, what are you doing?

Anyway give this a try set_time_limit() or maybe max_execution_time

They should help
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-06-2007, 03:46 PM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 7,360
Last Blog:
Tramp Variables
Credits: 1
Rep Power: 20
Jordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud of
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default

The max_execution_time is set in the ini file but set_time_limit() seems to work for most of my projects. I had a project that took about 4 hours to complete once and it was all done in PHP. It pulled about 500,000 rows of data from two different databases across a WAN. The WAN was slow at that.

Anyway, to resolve the time issue I had to rewrite the PHP and use PHP to do most of the functions instead of the database (as I had when it took 4 hours to execute). This was a bit more code and kind of confusing but in the end it only took 20 seconds to complete.

Nice suggestion Sidewinder!
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog
Don't hesitate to ask any questions that you have! Check out our ASCII Calculator!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP: Execution Time Function Jordan PHP Tutorials 8 09-22-2008 01:54 AM
A time showing tutorial ahsan16 VB Tutorials 1 01-10-2007 04:50 AM
Time format xXHalfSliceXx HTML Programming 0 12-10-2006 07:15 PM
Odd Timestamp dirkfirst C# Programming 10 12-08-2006 04:40 PM
Maximum Execution Time Lop PHP Forum 4 07-15-2006 08:25 PM


All times are GMT -5. The time now is 12:44 AM.

Contest Stats

Xav ........ 1333.07
MeTh0Dz|Reb0rn ........ 1059.52
John ........ 887.37
morefood2001 ........ 879.43
marwex89 ........ 869.98
WingedPanther ........ 851.68
Brandon W ........ 764.23
chili5 ........ 312.39
Steve.L ........ 254.16
dcs ........ 225.25

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 82%

Ads