93
|
1 using System;
|
|
2 using Implab.Diagnostics;
|
|
3 using Implab.Parallels;
|
|
4 using Implab;
|
103
|
5 using System.Collections.Generic;
|
|
6 using System.Collections.Concurrent;
|
136
|
7 using System.Threading;
|
150
|
8 using Implab.JSON;
|
|
9 using System.IO;
|
93
|
10
|
|
11 namespace MonoPlay {
|
|
12 class MainClass {
|
145
|
13
|
|
14
|
93
|
15 public static void Main(string[] args) {
|
94
|
16 if (args == null)
|
|
17 throw new ArgumentNullException("args");
|
|
18
|
103
|
19 var t1 = Environment.TickCount;
|
93
|
20
|
150
|
21 for(int i =0; i < 1000000; i++)
|
|
22 using (var tw = new StringWriter()) {
|
|
23 var jw = new JSONWriter(tw);
|
|
24
|
|
25 jw.WriteValue("\r\nhere\tvalue\u0002\u0003");
|
|
26
|
|
27 //Console.WriteLine(tw);
|
145
|
28 }
|
121
|
29
|
150
|
30
|
|
31
|
103
|
32 var t2 = Environment.TickCount;
|
125
|
33 Console.WriteLine("done: {0} ms, {1:.00} Mb, {2} GC", t2 - t1, GC.GetTotalMemory(false) / (1024*1024), GC.CollectionCount(0) );
|
93
|
34
|
|
35 }
|
136
|
36
|
150
|
37 static void DoTest() {
|
|
38
|
|
39
|
|
40
|
145
|
41 }
|
136
|
42
|
93
|
43 }
|
|
44 }
|