Find the difference and explain why it is so significant.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ForCodeWars
{
class Program
{
static void Main(string[] args)
{
const int length = 10000;
int[,] arrayA = new int[length, length];
Stopwatch timer = new Stopwatch();
timer.Start();
for (int i = 0; i < length; i++)
{
for (int j = 0; j < length; j++)
{
arrayA[i, j] = i;
}
}
timer.Stop();
Console.WriteLine(timer.ElapsedMilliseconds);
Stopwatch timer2 = new Stopwatch();
timer2.Start();
int[,] arrayB = new int[length, length];
for (int i = 0; i < length; i++)
{
for (int j = 0; j < length; j++)
{
arrayB[j, i] = i;
}
}
timer2.Stop();
Console.WriteLine(timer2.ElapsedMilliseconds);
Console.ReadKey();
}
}
}