Hi all,
I have 2 functions that both need to do similar things. Basically I can do it by either writing a third parametric function or I can write a third and a fourth function. ie,
function One(){ ...
... DoSomethingOne();...}
function Two{....
...DoSomethingTwo()...}
function DoSomethingOne(){...
...}
function DoSOmethingTwo(){...
....}
In the above case what I get is 16 extra general (not global) variables and a longer script with similar lines of code.
OR the second way is.
function One(){ ...
... DoSomethingOne(1);...}
function Two{....
...DoSomethingTwo(1)...}
function DoSomethingOne(CallingFunction){...
if (CallingFunction==1) {} ...etc.
...}
In this case I only use 4 local variables but I have to have too many if...then..else.. statements.
What I am asking is which one is more efficient in EFS? I have to compute those functions at every new tick. So does anybody know which code will keep the computer less busy or use less resources? Or are they both the same in terms of efficiency?
Thanks in advance
I have 2 functions that both need to do similar things. Basically I can do it by either writing a third parametric function or I can write a third and a fourth function. ie,
function One(){ ...
... DoSomethingOne();...}
function Two{....
...DoSomethingTwo()...}
function DoSomethingOne(){...
...}
function DoSOmethingTwo(){...
....}
In the above case what I get is 16 extra general (not global) variables and a longer script with similar lines of code.
OR the second way is.
function One(){ ...
... DoSomethingOne(1);...}
function Two{....
...DoSomethingTwo(1)...}
function DoSomethingOne(CallingFunction){...
if (CallingFunction==1) {} ...etc.
...}
In this case I only use 4 local variables but I have to have too many if...then..else.. statements.
What I am asking is which one is more efficient in EFS? I have to compute those functions at every new tick. So does anybody know which code will keep the computer less busy or use less resources? Or are they both the same in terms of efficiency?
Thanks in advance
Comment