Mercurial > pub > ImplabNet
comparison MonoPlay/Program.cs @ 104:5f10d54b45df v2
renamed Promise.Last -> Promise.On
Promise.On doesn't changes Promise.IsExclusive property
author | cin |
---|---|
date | Sun, 09 Nov 2014 23:03:45 +0300 |
parents | b3f5bc613905 |
children | f3bdb7ba59b9 |
comparison
equal
deleted
inserted
replaced
103:b3f5bc613905 | 104:5f10d54b45df |
---|---|
10 public static void Main(string[] args) { | 10 public static void Main(string[] args) { |
11 if (args == null) | 11 if (args == null) |
12 throw new ArgumentNullException("args"); | 12 throw new ArgumentNullException("args"); |
13 | 13 |
14 var q1 = new MTQueue<int>(); | 14 var q1 = new MTQueue<int>(); |
15 var q2 = new ConcurrentQueue<int>(); | 15 var q2 = new Queue<int>(); |
16 | 16 |
17 const int count = 10000000; | 17 const int count = 10000000; |
18 | 18 |
19 var t1 = Environment.TickCount; | 19 var t1 = Environment.TickCount; |
20 | 20 |
30 q2.Enqueue(i); | 30 q2.Enqueue(i); |
31 | 31 |
32 t2 = Environment.TickCount; | 32 t2 = Environment.TickCount; |
33 Console.WriteLine("LinkedList: {0} ms", t2 - t1); | 33 Console.WriteLine("LinkedList: {0} ms", t2 - t1); |
34 | 34 |
35 q2 = new ConcurrentQueue<int>(); | 35 q2 = new Queue<int>(); |
36 | 36 |
37 t1 = Environment.TickCount; | 37 t1 = Environment.TickCount; |
38 | 38 |
39 for (var i = 0; i < count; i++) | 39 for (var i = 0; i < count; i++) |
40 lock (q2) | 40 lock (q2) |