|
-
Apr 29th, 2002, 02:02 PM
#1
Thread Starter
Frenzied Member
(ASP) nested FOR loops, which way is more efficiant
which is better (both are large), this:
Code:
For x= 1 To 2
For y=1 To 30
blah
Next
Next
or this
Code:
For y=1 to 30
For x=1 to 2
blah
Next
Next
they both do the process 60 times but is one way better than the other?
thanks
michael
I'm off to GalahTech, hope to see you there.
If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.
-
Apr 29th, 2002, 02:19 PM
#2
Frenzied Member
They should be the same. You could try benchmarking to find out, but the program isn't having to do anything different, and you aren't stacking anything or consuming extra memory.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
Apr 29th, 2002, 02:22 PM
#3
Thread Starter
Frenzied Member
OK, I figured that was the case. I was just thinking that 2 for loops for 30 was better than 30 for loops for 2 
thanks
michael
I'm off to GalahTech, hope to see you there.
If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|