[development] coding standard question

Steve Rude steve at achieveinternet.com
Mon Aug 27 19:18:10 UTC 2007


You are outputting in seconds.  Sure .06 seconds doesn't sound like a 
lot, but when you multiply that times 1000 to get milliseconds, it 
starts to look more substantial...

1326ms vs. 1382ms is 60ms, and when normal page load times are somewhere 
around 200ms, it makes a substantial difference.

Steve Rude

mark burdett wrote:
> Hi, in some simple command-line tests I could not find a difference (in php 5.2)
>
>   true: 1.32612895966  TRUE: 1.38275790215
>   true: 1.34794092178  TRUE: 1.39009809494
>   true: 1.34102320671  TRUE: 1.38674616814
>   true: 1.2856991291  TRUE: 1.27452993393
>   true: 1.34056401253  TRUE: 1.2749080658
>   true: 1.31166195869  TRUE: 1.33323001862
>   true: 1.34053897858  TRUE: 1.27428483963
>   true: 1.28342199326  TRUE: 1.33444595337
>
> <?php
> $loop = 0;
> while ($loop < 8) {
>   $count = 0;
>   $start = microtime(true);
>   while ($count < 4000000) {
>     $test = true;
>     if (true) {
>       $count++;
>     }
>   }
>   echo '  true: ';
>   echo microtime(true) - $start;
>
>   $count = 0;
>   $start = microtime(true);
>   while ($count < 4000000) {
>     $test = TRUE;
>     if (TRUE) {
>       $count++;
>     }
>   }
>   echo '  TRUE: ';
>   echo microtime(true) - $start;
>   echo "\n";
>   $loop++;
> }
>
> --mark
>
> On 8/27/07, Karoly Negyesi <karoly at negyesi.net> wrote:
>   
>> I do not believe that true could be faster than TRUE when php is case agnostic about its identifiers. Maybe there is time taken to lowercase TRUE ... but if you can measure lowercasing four characters in the parsing stage where only ASCII is supported, congratulations.
>>
>> About commas, yes the D5 menu defintiions are ugly sometimes. Have you seen D6 :) ?
>>
>>     
>
>   


-- 
Steve Rude + Lead Developer
*AchieveInternet*
(800) 618-877 x 202

http://www.achieveinternet.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20070827/52307cb1/attachment.htm 


More information about the development mailing list