Esempio n. 1
0
        private void HandcodedOrm()
        {
            var       orm       = new HandCodedOrmPosts();
            const int iteration = 1;

            using (var sw = new AutoStopWatch($"{nameof(HandcodedOrm),-20} {{0}}", iteration, _reporter))
            {
                while (sw.IsRunnning)
                {
                    for (var j = 0; j < iteration; j++)
                    {
                        orm.Run();
                    }
                }
            }
        }
Esempio n. 2
0
        public void sqlOpen()
        {
            const int iteration = 10;

            using (var sw = new AutoStopWatch($"{nameof(sqlOpen),-20} {{0}}", iteration, _reporter))
            {
                while (sw.IsRunnning)
                {
                    for (var j = 0; j < iteration; j++)
                    {
                        using (var cnn = new SqlConnection(Program.ConnectionString))
                        {
                            cnn.Open();
                        }
                    }
                }
            }
        }