In all the frameworks/platforms you've got ... I'm getting some very strange
results here . very very strange results... Please confirm.
It's a silly benchmark, but I was shocked at the results !!. Please run
at least 3 times and report back ?
Apparently this is a bad case for a JIT ?. (if so, why ?).
Gopal
------------------------------------------------------------------------
using System;
public class FooBar
{
public static void Test(bool foobar)
{
int x;
if(foobar)
{
x=1;
}
else
{
x=0;
}
}
}
public class Kicker
{
public static void Main()
{
DateTime t1=DateTime.Now;
for(int i=0;i<1024;i++)
{
FooBar.Test((i%2)==0);
}
DateTime t2=DateTime.Now;
Console.WriteLine((t2.Millisecond - t1.Millisecond)+"
Milliseconds");
}
}