Advertisement
glock878

Measure

Feb 24th, 2014
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.02 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Diagnostics;
  6. using System.Threading;
  7.  
  8. namespace ConsoleApplication1
  9. {
  10.     class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             Stopwatch stopWatch = new Stopwatch();
  15.             stopWatch.Start();
  16.             int[,] arr = new int[10000, 10000];
  17.             for (int i = 0; i < arr.GetLength(0); i++)
  18.                 for (int j = 0; j < arr.GetLength(1); j++)
  19.                     arr[i, j] = ((i + 1) * j);
  20.             for (int i = 0; i < arr.GetLength(0); i++)
  21.                 for (int j = 0; j < arr.GetLength(1); j++)
  22.                     Console.Write(" {0}", arr[i, j]);
  23.             stopWatch.Stop();
  24.             TimeSpan ts = stopWatch.Elapsed;
  25.             string elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10);
  26.             Console.WriteLine("RunTime " + elapsedTime);
  27.             Console.ReadKey();
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement