Advertisement
Guest User

Untitled

a guest
Feb 5th, 2013
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.67 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Diagnostics;
  4.  
  5. namespace Sharp
  6. {
  7.     class Program
  8.     {
  9.         class Foo
  10.         {
  11.             int i;
  12.             public Foo(int ii)
  13.             {
  14.                 i = ii;
  15.             }
  16.         }
  17.  
  18.         static void Main(string[] args)
  19.         {
  20.             const int SIZE = 10000000;
  21.  
  22.             Foo[] foos = new Foo[SIZE];
  23.  
  24.             var timer = new Stopwatch();
  25.  
  26.             timer.Start();
  27.  
  28.             for (int i = 0; i < SIZE; ++i)
  29.             {
  30.                 foos[i] = new Foo(i);
  31.             }
  32.  
  33.             System.Console.WriteLine(timer.ElapsedMilliseconds);
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement