G
Gianco
Can someone explain me why when I execute the VB code (on a smart
device, windows ce 4) VB 'thinks' about 130 secs and C# about 4
seconds?
In VB:
------
Dim i As Double
Dim a As Double
Dim b As Double
Dim x As Integer
Dim s1 As Integer
Dim s2 As Integer
s1 = System.Environment.TickCount
a = 6
b = 3
For i = 1 To 600000
x = (a * i) + 3.89 + (b * i)
Next
s2 = System.Environment.TickCount
MessageBox.Show((s2 - s1).ToString())
In C#:
------
double i;
double a;
double b;
int x;
int s1;
int s2;
s1 = System.Environment.TickCount;
a = 6;
b = 3;
for (i = 1; i <= 600000; ++i)
{
x = (int)((a * i) + 3.89 + (b * i));
}
s2 = System.Environment.TickCount;
MessageBox.Show((s2 - s1).ToString());
Gianco
device, windows ce 4) VB 'thinks' about 130 secs and C# about 4
seconds?
In VB:
------
Dim i As Double
Dim a As Double
Dim b As Double
Dim x As Integer
Dim s1 As Integer
Dim s2 As Integer
s1 = System.Environment.TickCount
a = 6
b = 3
For i = 1 To 600000
x = (a * i) + 3.89 + (b * i)
Next
s2 = System.Environment.TickCount
MessageBox.Show((s2 - s1).ToString())
In C#:
------
double i;
double a;
double b;
int x;
int s1;
int s2;
s1 = System.Environment.TickCount;
a = 6;
b = 3;
for (i = 1; i <= 600000; ++i)
{
x = (int)((a * i) + 3.89 + (b * i));
}
s2 = System.Environment.TickCount;
MessageBox.Show((s2 - s1).ToString());
Gianco