Which Operation is Faster ?

Questions about MultiCharts and user contributed studies.
Guest

Which Operation is Faster ?

Postby Guest » 02 Aug 2007

Which Operation is Faster ?

this ?

Code: Select all

input: variableA(true);

if VariableA then dothis;



or this ?

Code: Select all

input: VariableA(1);

if VariableA=1 then dothis;


User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 02 Aug 2007

Hello,

There is no difference.

Guest

Postby Guest » 02 Aug 2007

Hello,

There is no difference.

even after 1000 evaluations ?

e.g. if I have thousands lines of code, with lots of these type of statements, one method should be more efficient than the other.

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 02 Aug 2007

Is such a case the first of the two codes -

input: variableA(true);

if VariableA then dothis; -


would be more efficient. And it is easier to read, too.

Guest

Postby Guest » 02 Aug 2007

Many thanks !


Return to “MultiCharts”