Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Diagnostics;
- namespace Sharp
- {
- class Program
- {
- class Foo
- {
- public int i;
- public Foo(int ii)
- {
- i = ii;
- }
- }
- static void Main(string[] args)
- {
- const int SIZE = 10000000;
- Foo[] foos = new Foo[SIZE];
- var timer = new Stopwatch();
- timer.Start();
- for (int i = 0; i < SIZE; ++i)
- {
- foos[i] = new Foo(i);
- }
- System.Console.WriteLine(timer.ElapsedMilliseconds);
- System.IO.StreamWriter fout = new System.IO.StreamWriter("ints.txt");
- for (int i = 0; i < SIZE; ++i)
- {
- fout.WriteLine(foos[i].i);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement