Jump to content

Execution Time

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
smith

smith

    Programmer

  • Members
  • PipPipPipPip
  • 153 posts
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?

for (int i;;) {

   cout << "Smith";

}


#2
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
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 :)

#3
Guest_Jordan_*

Guest_Jordan_*
  • Guests
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!