Switch VS IF
#9

Quote:
Originally Posted by Don Correlli
Use switch, it's faster than else/if.
That is a false statement as it depend of what you do in the switch, maybe doing it with if's will be easier, require less operations and so be faster.

Try to do a switch with a float value and cases such as 'case 0.0 .. 10.0', and then compare the speed with a similar if structure, you will see that the if structure is much faster.
Reply


Messages In This Thread
Switch VS IF - by Luka P. - 22.11.2009, 19:00
Re: Switch VS IF - by Correlli - 22.11.2009, 19:04
Re: Switch VS IF - by Luka P. - 22.11.2009, 19:14
Re: Switch VS IF - by Kyosaur - 22.11.2009, 19:19
Re: Switch VS IF - by Backwardsman97 - 22.11.2009, 19:19
Re: Switch VS IF - by FUNExtreme - 22.11.2009, 19:22
Re: Switch VS IF - by gotenks918 - 22.11.2009, 19:26
Re: Switch VS IF - by Backwardsman97 - 22.11.2009, 19:28
Re: Switch VS IF - by yom - 22.11.2009, 19:32
Re: Switch VS IF - by Correlli - 22.11.2009, 19:35
Re: Switch VS IF - by Luka P. - 22.11.2009, 19:39
Re: Switch VS IF - by Correlli - 22.11.2009, 19:50
Re: Switch VS IF - by Google63 - 22.11.2009, 20:02
Re: Switch VS IF - by Correlli - 22.11.2009, 20:51

Forum Jump:


Users browsing this thread: 3 Guest(s)