Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Basic C# question
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01133939
Message ID:
01134121
Vues:
24
Hi Alex

You might want to check this article in regards to your question.

http://techrepublic.com.com/5254-6257-0.html?forumID=99&threadID=184332&messageID=2048042&id=2926438

Simon


>This is a basic question to enhance my understanding.
>
>In a loop is the condition tokenized once and checked every time or is it calculated in every iteration?
>
>Take this example:
>
>for (int i = 0; i < this.TreeView1.Nodes.Count; i++)
>{
>}
>
>
>or is it more efficient (faster) to do:
>
>int nCount = this.TreeView1.Nodes.Count;
>for (int i = 0; i < nCount; i++)
>{
>}
>
>
>Granted, in a short loop it does not really matter as the time differences would be measured in microseconds but the principle of the thing is what I'm looking for.
>
>Every little bit of new knowledge on .NET helps :)
Simon White
dCipher Computing
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform