Exemple #1
0
        public void Perf(int cnt)
        {
            var got = JsonReader.ToDoc <DocWithArray>(JSON1);
            var sw  = System.Diagnostics.Stopwatch.StartNew();

            System.Threading.Tasks.Parallel.For(0, cnt, i => //  for (var i=0; i<cnt; i++)
            {
                got = JsonReader.ToDoc <DocWithArray>(JSON1);
                Aver.IsNotNull(got);
            });

            var el = sw.ElapsedMilliseconds;

            Conout.SeeArgs("Did {0:n0} in {1:n0} ms at {2:n0} ops/sec".Args(cnt, el, cnt / (el / 1000d)));
        }