>
>
> I include my sample.
>
This time for real
using System;
class X {
static void Main ()
{
var start = DateTime.UtcNow;
decimal d = 0;
double f;
for (int ct = 0; ct < 1000000; ct++)
d = Convert.ToDecimal(Math.Pow(ct, 4));
Console.WriteLine ("first={0}", DateTime.UtcNow -start);
start = DateTime.UtcNow;
for (int ct = 0; ct < 1000000; ct++)
d = new Decimal(1.4);
Console.WriteLine ("decimal={0}", DateTime.UtcNow -start);
start = DateTime.UtcNow;
for (int ct = 0; ct < 1000000; ct++){
f = Math.Pow(ct, 4);
}
Console.WriteLine ("justpow={0}", DateTime.UtcNow -start);
start = DateTime.UtcNow;
for (int ct = 0; ct < 1000000; ct++){
Convert.ToDecimal(Math.Sqrt(Convert.ToDouble(d)) * 4 *
Math.Atan(Convert.ToDouble(ct)));
}
Console.WriteLine ("second={0}", DateTime.UtcNow -start);
start = DateTime.UtcNow;
for (int ct = 0; ct < 1000000; ct++){
d = Convert.ToDecimal(Math.Pow(ct, 4));
d = Convert.ToDecimal(Math.Sqrt(Convert.ToDouble(d)) * 4 *
Math.Atan(Convert.ToDouble(ct)));
}
Console.WriteLine ("Combined={0}", DateTime.UtcNow -start);
}
static void Second ()
{
int ct = 1;
decimal d = Convert.ToDecimal(Math.Pow(ct, 4));
d = Convert.ToDecimal(Math.Sqrt(Convert.ToDouble(d)) * 4 *
Math.Atan(Convert.ToDouble(ct)));
}
}
_______________________________________________
Mono-list maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list