futurshox Posted January 7, 2009 Share Posted January 7, 2009 Say you have a script which runs in cron to do a specific job, so it's not part of a web page. It has data going in and out, with a few database transactions on the way. It might have to do the same job with data coming from one to 60+ inputs at once, looping through each inputted data chunk in turn. Yeah, that's as open-ended as anything, I realise, but I'm just looking for a ballpark idea of how long such a script should take to run. 50ms? 500ms? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/139895-how-long-should-the-average-php-script-take-to-run/ Share on other sites More sharing options...
premiso Posted January 7, 2009 Share Posted January 7, 2009 On average, with a database, usually about 0.xxxx seconds somewhere around there. But it really depends on the processes You can look at the bottom of this site and see an average time: "Page created in 0.113 seconds with 17 queries." But you said it could haev 60+ inputs to do, that is 60 queries. So you could times that by 60 and get an average time your script will take to run. But with databases it never is that simple, it will probably take about 5-10 seconds+ to run 60 queries on 1 page. If you can consolidate the queries that would speed up the processing time. Quote Link to comment https://forums.phpfreaks.com/topic/139895-how-long-should-the-average-php-script-take-to-run/#findComment-731919 Share on other sites More sharing options...
futurshox Posted January 7, 2009 Author Share Posted January 7, 2009 Thanks, that helps. Quote Link to comment https://forums.phpfreaks.com/topic/139895-how-long-should-the-average-php-script-take-to-run/#findComment-731962 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.