Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Which Should I Use IF/ENDIF or IIF
Message
 
To
14/06/2002 14:40:33
Guy Pardoe
Pardoe Development Corporation
Peterborough, New Hampshire, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00668532
Message ID:
00668730
Views:
26
>Hi George,
>
>For a million loops, something like 1.4 seconds versus 1.2 seconds, consistently and with nothing else running.
>
>I think I mentioned this earlier ... I have known IF...ENDIF to be faster for quite some time now. I thought it was common wisdom and I was surprised when I saw messages stating IIF was faster. So I just took a couple of minutes and whipped up this example.
>
>You can try the code yourself for further validation.
>
>Bottom line ... I have no inside knowledge here, but I have always believed that for all versions ... as long as IIF has been around, IF...ENDIF has been faster.
>
Guy

I didn't do a real thorough test (I had other apps open and only ran about 4 iterations of the test). However, on a PIII 933, I got inconsistent results. In some cases IIF() was faster and in others it wasn't. Which is truly faster, however, took a back seat to the differences between the two over a million iterations. The largest amount was less than 1/10th of a second. So I would have to conclude that unless the routine was being called in excess of a million times, which is actually faster is pretty much of a moot point.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform