Program.cs
34 lines
| 816 B
| text/x-csharp
|
CSharpLexer
/ MonoPlay / Program.cs
cin
|
r93 | using System; | ||
using Implab.Diagnostics; | ||||
using Implab.Parallels; | ||||
using Implab; | ||||
cin
|
r103 | using System.Collections.Generic; | ||
using System.Collections.Concurrent; | ||||
cin
|
r93 | |||
namespace MonoPlay { | ||||
class MainClass { | ||||
public static void Main(string[] args) { | ||||
cin
|
r94 | if (args == null) | ||
throw new ArgumentNullException("args"); | ||||
cin
|
r103 | const int count = 10000000; | ||
var t1 = Environment.TickCount; | ||||
cin
|
r93 | |||
cin
|
r125 | for (int i = 0; i < count; i++) { | ||
var p = new Promise<int>(); | ||||
p.On(x => {}).On(x => {}); | ||||
cin
|
r93 | |||
cin
|
r125 | p.Resolve(i); | ||
} | ||||
cin
|
r121 | |||
cin
|
r103 | var t2 = Environment.TickCount; | ||
cin
|
r125 | Console.WriteLine("done: {0} ms, {1:.00} Mb, {2} GC", t2 - t1, GC.GetTotalMemory(false) / (1024*1024), GC.CollectionCount(0) ); | ||
cin
|
r93 | |||
} | ||||
} | ||||
} | ||||