Пример #1
0
 private void HandCodedOrm()
 {
     using (var orm = new HandCodedOrm())
         using (var sw = new AutoStopWatch($"{nameof(HandCodedOrm),-20} {{0}}", 1, _reporter))
         {
             while (sw.IsRunnning)
             {
                 orm.Run();
             }
         }
 }
Пример #2
0
 private void GetCurrentProcess()
 {
     using (var sw = new AutoStopWatch($"{nameof(GetCurrentProcess),-20} {{0}}", 350, _reporter))
     {
         while (sw.IsRunnning)
         {
             for (var j = 0; j < 350; j++)
             {
                 Process.GetCurrentProcess();
             }
         }
     }
 }
Пример #3
0
 private void PInvokeEmpty()
 {
     using (var sw = new AutoStopWatch($"{nameof(PInvokeEmpty),-20} {{0}}", 1000, _reporter))
     {
         while (sw.IsRunnning)
         {
             for (var j = 0; j < 1000; j++)
             {
                 Pinvoke.Empty();
             }
         }
     }
 }
Пример #4
0
        private void ParseDec()
        {
            var decStr = "-49823174320.9293800";

            using (var sw = new AutoStopWatch($"{nameof(ParseDec),-20} {{0}}", 40, _reporter))
            {
                while (sw.IsRunnning)
                {
                    for (var j = 0; j < 40; j++)
                    {
                        decimal.Parse(decStr);
                    }
                }
            }
        }