Flasher Archive
[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]
| Subject: | Re: FLASH: If vs. boolean - which one is faster ? |
| From: | Gregg Caines |
| Date: | Wed, 19 Jul 2000 08:58:28 +0100 |
Yeesh...sorry..you are right...
If the IF statement evaluates to true, then there is a jump.
If it evaluates to false, then nothing happens.
The line 'Set Variable "c" = c + ( a > b )' is faster than the IF
statement that evaluates to true, and slower than the IF
statement that evaluates to false.
So... like Damien said, it depends on the frequency of 'trues'
and 'falses' you expect.
---------------------------------------------------
Gregg Caines
n e o m e t r i x systems inc.
http://www.neometrixsystems.com
gcaines
> It depends on how often (a > b) is true.
>
> if (a > b) is not true very often, the first may be faster
> otherwise the second will be faster
>
> best way is to test and time a loop using gettimer
>
>
> > To: flasher
> > Subject: FLASH: If vs. boolean - which one is faster ?
> >
> >
> > Hi
> >
> > does any body know if there is any difference in speed
> > between the use of if statements and boolean arguments ?
> >
> > for example, if substitute
> >
> > If ( a > b )
> > Set Varible "c" = c + 1
> > End If
> >
> > with :
> >
> > Set Variable "c" = c + ( a > b )
> >
> > ?__gabriel
>
> flasher is generously supported by...
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> flashforward2000 and the Flash(tm) Film Festival
> July 24-26, 2000, NEW YORK CITY, Hammerstein Ballroom
> www.flashforward2000.com
> Produced by United Digital Artists and lynda.com
> Sponsored by Macromedia, Adobe Systems, Fusion, Inc, AtomFilms,
> shockwave.com and Electric Rain.
> 1.877.4.FLASH.4 or (1.805.640.6679 outside the US and Canada)
> Register before June 30 and save $200!!-- www.flashforward2000.com
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> To unsubscribe or change your list settings go to
> http://www.chinwag.com/flasher or email help
>
flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flashforward2000 and the Flash(tm) Film Festival
July 24-26, 2000, NEW YORK CITY, Hammerstein Ballroom
www.flashforward2000.com
Produced by United Digital Artists and lynda.com
Sponsored by Macromedia, Adobe Systems, Fusion, Inc, AtomFilms,
shockwave.com and Electric Rain.
1.877.4.FLASH.4 or (1.805.640.6679 outside the US and Canada)
Register before June 30 and save $200!!-- www.flashforward2000.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email help
Replies
RE: FLASH: If vs. boolean - which one is, Damien Morton
[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]

