If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

I just tried it, for me the first one was consistently slower by around 0.0005 seconds over 10,000 iterations. You can use this bit of code to quickly benchmark code, run the script a few times to get a consistent time.

$i = 0;
// Change 10000 to the number of times to run the code. The larger the function the less you will likely want to run it.
while ($i != 10000)
{
// Code you want to benchmark goes here.
echo "</p>\n";

I just tried it, for me the first one was consistently slower by around 0.0005 seconds over 10,000 iterations. You can use this bit of code to quickly benchmark code, run the script a few times to get a consistent time....

Is that 0.0005 seconds per iteration, or per the full 10,000 iterations. If the latter, it's not even worth a second of your time to worry about. If the former (.0005sec/instance) it's still really not worth worrying about unless you're programming some large, intense, high-demand application where every microsecond matters.

Is that 0.0005 seconds per iteration, or per the full 10,000 iterations. If the latter, it's not even worth a second of your time to worry about. If the former (.0005sec/instance) it's still really not worth worrying about unless you're programming some large, intense, high-demand application where every microsecond matters.

In PHP??!?

Originally Posted by temp.user123

You know... You're not so smart. Do you need me to educate you?
If you say, "please," (and do so, nicely) then I will show you where you're dead wrong.