예제 #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);
                    }
                }
            }
        }