I have been told numerous times that it is a big mistake trusting microtime tests.<br><br>if you want to get /real/ run time results you need to use tools like xdebug.<br><br><div><span class="gmail_quote">On 8/27/07, <b class="gmail_sendername">
mark burdett</b> <<a href="mailto:mfburdett@gmail.com">mfburdett@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
well, it seems like coin tossing to me. But I haven't let it run all day.<br><br>in this test, TRUE wins:<br>mark@subtle ~/Sites % php pp/test.php<br> true: 1.26725101471 TRUE: 1.25381183624<br> true: 1.29299092293
TRUE: 1.26070404053<br> true: 1.27665114403 TRUE: 1.24824905396<br> true: 1.31866884232 TRUE: 1.25040316582<br> true: 1.27103209496 TRUE: 1.2434129715<br> true: 1.28510403633 TRUE: 1.24616312981<br> true: 1.29535198212
TRUE: 1.24373793602<br> true: 1.27827787399 TRUE: 1.22749304771<br><br>in this one a tie:<br>mark@subtle ~/Sites % php pp/test.php<br> true: 1.26420211792 TRUE: 1.24726390839<br> true: 1.25392603874 TRUE: 1.25495100021
<br> true: 1.25082397461 TRUE: 1.24722003937<br> true: 1.25069499016 TRUE: 1.24976992607<br> true: 1.25077605247 TRUE: 1.247205019<br> true: 1.25090909004 TRUE: 1.25059509277<br> true: 1.30386614799 TRUE: 1.31354403496
<br> true: 1.2652528286 TRUE: 1.25868320465<br><br>TRUE wins another one:<br>mark@subtle ~/Sites % php pp/test.php<br> true: 1.23990178108 TRUE: 1.21928906441<br> true: 1.22088694572 TRUE: 1.21982097626<br> true: 1.21747803688
TRUE: 1.22024011612<br> true: 1.21896100044 TRUE: 1.22330522537<br> true: 1.22763895988 TRUE: 1.2149310112<br> true: 1.21694612503 TRUE: 1.21505308151<br> true: 1.21890115738 TRUE: 1.21598815918<br> true: 1.21745586395
TRUE: 1.21514201164<br><br>--mark<br><br>On 8/27/07, Steve Rude <<a href="mailto:steve@achieveinternet.com">steve@achieveinternet.com</a>> wrote:<br>><br>> You are outputting in seconds. Sure .06 seconds doesn't sound like a lot,
<br>> but when you multiply that times 1000 to get milliseconds, it starts to look<br>> more substantial...<br>><br>> 1326ms vs. 1382ms is 60ms, and when normal page load times are somewhere<br>> around 200ms, it makes a substantial difference.
<br>><br>> Steve Rude<br>><br>><br>> mark burdett wrote:<br>> Hi, in some simple command-line tests I could not find a difference (in php<br>> 5.2)<br>><br>> true: 1.32612895966 TRUE: 1.38275790215
<br>> true: 1.34794092178 TRUE: 1.39009809494<br>> true: 1.34102320671 TRUE: 1.38674616814<br>> true: 1.2856991291 TRUE: 1.27452993393<br>> true: 1.34056401253 TRUE: 1.2749080658<br>> true: 1.31166195869
TRUE: 1.33323001862<br>> true: 1.34053897858 TRUE: 1.27428483963<br>> true: 1.28342199326 TRUE: 1.33444595337<br>><br>> <?php<br>> $loop = 0;<br>> while ($loop < 8) {<br>> $count = 0;<br>> $start = microtime(true);
<br>> while ($count < 4000000) {<br>> $test = true;<br>> if (true) {<br>> $count++;<br>> }<br>> }<br>> echo ' true: ';<br>> echo microtime(true) - $start;<br>><br>> $count = 0;
<br>> $start = microtime(true);<br>> while ($count < 4000000) {<br>> $test = TRUE;<br>> if (TRUE) {<br>> $count++;<br>> }<br>> }<br>> echo ' TRUE: ';<br>> echo microtime(true) - $start;
<br>> echo "\n";<br>> $loop++;<br>> }<br>><br>> --mark<br>><br>> On 8/27/07, Karoly Negyesi <<a href="mailto:karoly@negyesi.net">karoly@negyesi.net</a>> wrote:<br>><br>><br>> I do not believe that true could be faster than TRUE when php is case
<br>> agnostic about its identifiers. Maybe there is time taken to lowercase TRUE<br>> ... but if you can measure lowercasing four characters in the parsing stage<br>> where only ASCII is supported, congratulations.
<br>><br>> About commas, yes the D5 menu defintiions are ugly sometimes. Have you seen<br>> D6 :) ?<br>><br>><br>><br>><br>><br>><br>> --<br>> Steve Rude + Lead Developer<br>> AchieveInternet
<br>> (800) 618-877 x 202<br>><br>> <a href="http://www.achieveinternet.com">http://www.achieveinternet.com</a><br></blockquote></div><br><br clear="all"><br>-- <br>Oleg Terenchuk <br>Web Manager / Developer<br>
Phone: 917 - 306 - 5653