Click here to Skip to main content
16,006,475 members
Home / Discussions / C#
   

C#

 
AnswerRe: Performance difference?? Pin
Shy Agam27-Jul-07 10:02
Shy Agam27-Jul-07 10:02 
GeneralRe: Performance difference?? Pin
Luc Pattyn27-Jul-07 10:10
sitebuilderLuc Pattyn27-Jul-07 10:10 
GeneralRe: Performance difference?? Pin
Shy Agam27-Jul-07 10:13
Shy Agam27-Jul-07 10:13 
AnswerRe: Performance difference?? Pin
Luc Pattyn27-Jul-07 10:06
sitebuilderLuc Pattyn27-Jul-07 10:06 
GeneralRe: Performance difference?? Pin
BoneSoft27-Jul-07 10:29
BoneSoft27-Jul-07 10:29 
GeneralRe: Performance difference?? Pin
Luc Pattyn27-Jul-07 10:46
sitebuilderLuc Pattyn27-Jul-07 10:46 
AnswerRe: Performance difference?? Pin
Paul Conrad27-Jul-07 10:07
professionalPaul Conrad27-Jul-07 10:07 
AnswerRe: Performance difference?? Pin
snorkie27-Jul-07 10:51
professionalsnorkie27-Jul-07 10:51 
For what its worth, I just ran a test and got the following results. It looks like it doesn't matter for something this small.

Inside the loop took 552645639 ticks.
Outside the loop took 549520699 ticks.

The test code:

long timeIn = 0;<br />
long timeOut = 0;<br />
<br />
long l = System.DateTime.Now.Ticks;<br />
for (long x = 0; x < 10000000000; x++)<br />
{<br />
    int i = 1;<br />
    i++;<br />
}<br />
timeIn = System.DateTime.Now.Ticks - l;<br />
<br />
l = System.DateTime.Now.Ticks;<br />
int i2;<br />
for (long x = 0; x < 10000000000; x++)<br />
{<br />
    i2 = 1;<br />
    i2++;<br />
}<br />
timeOut = System.DateTime.Now.Ticks - l;<br />
<br />
MessageBox.Show("Time In: " + timeIn.ToString() + Environment.NewLine + "Time Out: " + timeOut.ToString());<br />


Hogan
GeneralRe: Performance difference?? Pin
PIEBALDconsult27-Jul-07 13:38
mvePIEBALDconsult27-Jul-07 13:38 
GeneralRe: Performance difference?? Pin
Luc Pattyn27-Jul-07 14:57
sitebuilderLuc Pattyn27-Jul-07 14:57 
AnswerMessage formatting question (expires on sunday) Pin
Luc Pattyn27-Jul-07 23:36
sitebuilderLuc Pattyn27-Jul-07 23:36 
GeneralRe: Message formatting question (expires on sunday) Pin
Shy Agam28-Jul-07 1:41
Shy Agam28-Jul-07 1:41 
GeneralRe: Message formatting question (expires on sunday) Pin
Luc Pattyn28-Jul-07 2:18
sitebuilderLuc Pattyn28-Jul-07 2:18 
QuestionHow to use C++ file ( header ) in C# project ? Pin
Yanshof27-Jul-07 8:35
Yanshof27-Jul-07 8:35 
AnswerRe: How to use C++ file ( header ) in C# project ? Pin
Judah Gabriel Himango27-Jul-07 9:21
sponsorJudah Gabriel Himango27-Jul-07 9:21 
GeneralRe: How to use C++ file ( header ) in C# project ? Pin
Yanshof27-Jul-07 10:37
Yanshof27-Jul-07 10:37 
GeneralRe: How to use C++ file ( header ) in C# project ? Pin
Judah Gabriel Himango27-Jul-07 10:55
sponsorJudah Gabriel Himango27-Jul-07 10:55 
Questionboolean variable as null Pin
ltmnm27-Jul-07 7:58
ltmnm27-Jul-07 7:58 
AnswerRe: boolean variable as null Pin
Justin Perez27-Jul-07 8:17
Justin Perez27-Jul-07 8:17 
GeneralRe: boolean variable as null Pin
Colin Angus Mackay27-Jul-07 22:52
Colin Angus Mackay27-Jul-07 22:52 
AnswerRe: boolean variable as null Pin
Abisodun27-Jul-07 8:19
Abisodun27-Jul-07 8:19 
GeneralRe: boolean variable as null Pin
Justin Perez27-Jul-07 8:21
Justin Perez27-Jul-07 8:21 
AnswerRe: boolean variable as null Pin
Paul Conrad27-Jul-07 8:22
professionalPaul Conrad27-Jul-07 8:22 
GeneralRe: boolean variable as null Pin
PhilDanger27-Jul-07 8:37
PhilDanger27-Jul-07 8:37 
GeneralRe: boolean variable as null Pin
Paul Conrad27-Jul-07 8:40
professionalPaul Conrad27-Jul-07 8:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.