Skip to content

Instantly share code, notes, and snippets.

@tbowers
Created October 2, 2014 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tbowers/cea8721a24e857bd8e78 to your computer and use it in GitHub Desktop.
Save tbowers/cea8721a24e857bd8e78 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
namespace ConsoleApplication1
{
public class Something
{
int[] things;
public Something() {
things = new int[10000000];
Random rnd = new Random();
for (int i = 0; i < things.Length; ++i) {
things[i] = rnd.Next();
}
}
}
static public class SomethingFactory
{
private static List<Something> listOfSomethings = new List<Something>();
public static Something CreateSomething() {
Something something = new Something();
listOfSomethings.Add(something);
return something;
}
}
class Program
{
static void Main(string[] args) {
while (true) {
Console.ReadKey();
Console.WriteLine("Creating...");
Something s = SomethingFactory.CreateSomething();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment