Hi,
I am doing some coding in .NET in which there is a set of commands that I have to execute either once or twice (second time with slight changes) depending on user input. So, I want to know which is most efficient -
Option 1.
For()
command 1
if (twice) command 2
End loop
Option 2.
for()
command 1
end loop
if (twice)
for()
command 2
end loop
Option 3.
if (twice) then
for ()
command 1
command 2
end loop
else
for()
command 1
end loop
end if
Thanks in advance
Arun
I am doing some coding in .NET in which there is a set of commands that I have to execute either once or twice (second time with slight changes) depending on user input. So, I want to know which is most efficient -
Option 1.
For()
command 1
if (twice) command 2
End loop
Option 2.
for()
command 1
end loop
if (twice)
for()
command 2
end loop
Option 3.
if (twice) then
for ()
command 1
command 2
end loop
else
for()
command 1
end loop
end if
Thanks in advance
Arun