class Program
{
public static int maxNum = 100000000;
static void Main(string[] args)
{
Stopwatch sw1 = new Stopwatch(), sw2 = new Stopwatch();
sw1.Start();
Test1();
sw1.Stop();
Console.WriteLine("Test1:" + sw1.ElapsedMilliseconds);
sw2.Start();
Test2();
sw2.Stop();
Console.WriteLine("Test2:" + sw2.ElapsedMilliseconds);
Console.ReadLine();
}
static void Test1()
{
for(int i = 0; i < maxNum;i++)
{
if(i%2 == 1)
{
Test11();
}
}
}
static void Test11()
{
}
static void Test2()
{
for (int i = 0; i < maxNum; i++)
{
Test22(i);
}
}
static void Test22(int i)
{
if (i % 2 == 1)
{
}
}
}
{
public static int maxNum = 100000000;
static void Main(string[] args)
{
Stopwatch sw1 = new Stopwatch(), sw2 = new Stopwatch();
sw1.Start();
Test1();
sw1.Stop();
Console.WriteLine("Test1:" + sw1.ElapsedMilliseconds);
sw2.Start();
Test2();
sw2.Stop();
Console.WriteLine("Test2:" + sw2.ElapsedMilliseconds);
Console.ReadLine();
}
static void Test1()
{
for(int i = 0; i < maxNum;i++)
{
if(i%2 == 1)
{
Test11();
}
}
}
static void Test11()
{
}
static void Test2()
{
for (int i = 0; i < maxNum; i++)
{
Test22(i);
}
}
static void Test22(int i)
{
if (i % 2 == 1)
{
}
}
}