Mercurial > pub > ImplabNet
diff MonoPlay/Program.cs @ 150:3258399cba83 v2
JSONWriter improvements
author | cin |
---|---|
date | Sat, 12 Dec 2015 22:12:44 +0300 |
parents | 706fccb85524 |
children | ec91a6dfa5b3 |
line wrap: on
line diff
--- a/MonoPlay/Program.cs Wed May 06 17:11:27 2015 +0300 +++ b/MonoPlay/Program.cs Sat Dec 12 22:12:44 2015 +0300 @@ -5,6 +5,8 @@ using System.Collections.Generic; using System.Collections.Concurrent; using System.Threading; +using Implab.JSON; +using System.IO; namespace MonoPlay { class MainClass { @@ -16,25 +18,27 @@ var t1 = Environment.TickCount; - for (int i = 0; i < 10000000; i++) { - - var p = new Promise<int>(); - p.On(HandleResult); - p.Resolve(i); + for(int i =0; i < 1000000; i++) + using (var tw = new StringWriter()) { + var jw = new JSONWriter(tw); + + jw.WriteValue("\r\nhere\tvalue\u0002\u0003"); + + //Console.WriteLine(tw); } + + var t2 = Environment.TickCount; Console.WriteLine("done: {0} ms, {1:.00} Mb, {2} GC", t2 - t1, GC.GetTotalMemory(false) / (1024*1024), GC.CollectionCount(0) ); } - static void HandleAction () - { - + static void DoTest() { + + + } - static void HandleResult(int x) { - - } } }