Hi, I'd like to know how to calculate something like this...
Processed in xx.xx seconds (xx% PHP / xx% SQL)
I've seen it done before, so I know it's possible. Can anyone help? Thanks.
grab one microtime() before the proccess and one after and compare
Thanks for replying.
I know how to get the whole page's load time... what I really want is the SQL and PHP percentages. For example, if most of the total time was spent waiting for query results, the SQL percent will be higher.
you can grab microtimes at any places in the flow of your script to time each part
So, just compare the time before and after a query, then add that to the SQL total? That should work... I'll give it a try. 🙂