sign in • sign up
web | myLot | discussions | tasks | blogs | news | photos
homeinterestsdiscussionstasksblogsnewsmessages friendsphotosearningsmyLotquizzes

which is the fastest loop? email this discussion to a friend?

myLot reputation of 76/100. gagana (661)3 years ago

for,while,do while


loops
 
 
sponsors
DC Area Attractions
Find museums, national monuments, historic homes, wineries and more.
www.fxva.com

life insurance washington dc?
Term/Whole/Universal/Variable… Free Life Insurance Quotes.
Life.Insurance202.com

Back in Action Spinecare& Rehab
Chiropractic - Spinal Decompression - Rehabilitation - Nutrition.
www.virginiachiro.com

User has not selected a best response.
tags:  loop, c, for, while, programming
 
1. myLot reputation of 72/100. zal3x89 (262)   3 years ago

I think it is for.But im not sure.
You should do some benchmarks to be sure.
Peace..


myLot reputation of 76/100. gagana (661)  3 years ago

ok may be it is thanx for the response

DC Area Attractions Find museums, national monuments, historic homes, wineries and more. www.fxva.com
 
2. myLot reputation of 68/100. anu_jak (1989)   3 years ago

it is for...coz u giv all teh details here as a parmeters

life insurance washington dc? Term/Whole/Universal/Variable… Free Life Insurance Quotes. Life.Insurance202.com
 
3. myLot reputation of 68/100. anu_jak (1989)   3 years ago

it is for...coz u giv all teh details here as a parmeters

Back in Action Spinecare & Rehab Chiropractic - Spinal Decompression - Rehabilitation - Nutrition. www.virginiachiro.com
 
4. myLot reputation of 90/100. raveemenon (727)   3 years ago

without doubt it is 'For'. then it depends upoon the circumstance i hope.let linguists comment!

Washington Dodge Dealer Learn About New Deals at Your Local Washington Dodge Dealer www.DodgeDealer.com/DodgeDifference
 
5. myLot reputation of 72/100. winter_man (385)   3 years ago

Oh this is the programming or computer language issue..I hate my programming subject so much. I took C++ Programming and I got D- for that subject! I hate it so much!

Hotel in Fairfax, VA Official Site- Hyatt Fair Lakes. Across from Fair Oaks Mall. Convenient access to Dulles Airport and Washington DC. Book Online for Hyatt.com's Rate Guarantee. fairlakes.hyatt.com
 
6. myLot reputation of 84/100. stonehr (635)   3 years ago

Very interesting question you have. I can't say that for loop will be faster than while.Anyhow You can't always use for loop. In many cases you must use while loop.If You use while than You'll have following: x++; while x>=100{... exit;}, so same elements You have in for loop also. for (x=0; x>=100; x++; ){....}
You always have a counter and some condition that is checked everytime after is variable changed. So it would be great to avoid use of loop whenever you can.

Moving Company, Washington Fast, and simple on-line storage space locator. Free move-in truck. www.MiniuStorage.com
 
7. myLot reputation of 93/100. dholey (954)   3 years ago

i know the truth, all the loop executes in similar way (their execution time is same), we have to make initialization of variable, we have to check a condition and we have to increase or decrease value, the only difference is these points are handled in different lines in different loops, noting else, if you want to make fast loop you have to make a register variables, it takes less time as it is in the memory of cpu.
but, while do wile and for loop has same execution time, the advantage i for loop is only convenience of putting all three main points of loop in one line nothing else.


my first ever earning from mlot

myLot reputation of 84/100. stonehr (635)  3 years ago

Yes You are right dholey, as I said the best is to try to avoid loops if it possible, and of course 'for' loop will have the smallest consumption of memory.
You are rated.:)


myLot reputation of 93/100. dholey (954)  3 years ago

thanks dude

Free Memory Loops Play Memory Loops, a Fun & Challenging Game at GameHouse. www.GameHouse.com
 
8. coolvin (15)   3 years ago

I dont understand what u mean by fastest loop.
Does mean the block of code in the loop,or the efficiency of the for,while statements.

anyway,
Do-while if the loop executes only once, because a comparison comes only at the end of the loop once in do-while when translated to machine code.

for means (usually) initialization also included with the loop.so slower.


But,speed of execution depends on a specific implementation.it varies with number of loops or how/when you initialize and increment counters ...

Washington DC Real Estate Appraiser Flanagan Associates Residential Appraisers. Fast Quality Service you can count on. www.flanaganappraisals.com
 
9. myLot reputation of 49/100. AshvinPatel (101)   3 years ago

its depands on ur code under loop.

D.C. Chrysler Dealer See the New 2009 Vehicles at Your Local Washington Chrysler Dealer www.ChryslerDealer.com
 
10. myLot reputation of 57/100. paki143 (634)   3 years ago

it is for loop,i am not sure but i think its for loop


myLot reputation of 93/100. dholey (954)  3 years ago

THERE IS NO DIFFERENCE ALL THREE POINTS (INITIALIZATION, CONDITION AND INCREMENTATION) are handled in different time so even in for loop it is same the control initializes the variable then checks the condition then runs the body then increments or decrements the value that is same as while, the only advantage is.... in for we can see all thee points in one single line where in other loops they are in different line ... so there is no difference in speed of different loops

Washington Post job with competitive salary Full- and part-time jobs near you. Apply for your dream job today! www.JobsRadar.com
 
sponsors
Washington Dodge Dealer
Learn About New Deals at Your Local Washington Dodge Dealer
www.DodgeDealer.com/DodgeDifference

Hotel in Fairfax, VA
Official Site- Hyatt Fair Lakes. Across from Fair Oaks Mall. Convenient access to Dulles Airport and Washington DC. Book Online for Hyatt.com's Rate Guarantee.
fairlakes.hyatt.com

Moving Company, Washington
Fast, and simple on-line storage space locator. Free move-in truck.
www.MiniuStorage.com

similar discussions
deja vu?
you know guys, did you feel the same thing happened to me? like you predict the things that you...
loop in basket ball
how to give more loop in basket ball
Rabbit Breeders (VA)
Are there any Holland Loop (dwarf) breeders in VA that anyone would recmend? Because I had a hand...
caught in a loop
Have you ever been caught in a situation over and over again?You thought you've learned your...
Loop
What diagrams can be used to show open and closed loops, apart from the basic input output?
Loop
What is the difference between open and closed looped control?
what is the deepest loop of the world
guessss??????
Free sound archive
I'm a game developer and I have not a sound designer so I'm searching a good free sound archive...
Computer programming
any one who can give the correct program on how to make program that may display 10 times 10...
C language
i want to make a
sponsors
Washington Dodge Dealer
Learn About New Deals at Your Local Washington Dodge Dealer
www.DodgeDealer.com/DodgeDifference
Hotel in Fairfax, VA
Official Site- Hyatt Fair Lakes. Across from Fair Oaks Mall. Convenient access to Dulles Airport and Washington DC. Book Online for Hyatt.com's Rate Guarantee.
fairlakes.hyatt.com
Moving Company, Washington
Fast, and simple on-line storage space locator. Free move-in truck.
www.MiniuStorage.com
Free Memory Loops
Play Memory Loops, a Fun & Challenging Game at GameHouse.
www.GameHouse.com
Washington DC Real Estate Appraiser
Flanagan Associates Residential Appraisers. Fast Quality Service you can count on.
www.flanaganappraisals.com
D.C. Chrysler Dealer
See the New 2009 Vehicles at Your Local Washington Chrysler Dealer
www.ChryslerDealer.com
Washington Post job with competitive salary
Full- and part-time jobs near you. Apply for your dream job today!
www.JobsRadar.com
Vein Treatment - No. VA
Learn About New Treatments for Veins at McLean Vein Center.
DC.Vein-Treatment.com
Washington DC AC
Summer's here -- Find local air conditioning dealers & services.
WashingtonDC.YellowPages.com
Payday Loans No Faxing
Small Loans From $250 To $2500 With Installments You Can Handle.
www.NextPaydayOnline.com
return to mylot
We are loading a word from our sponsors. No thanks, cancel loading.