Beispiel #1
0
        private static void Main()
        {
            var performance = new AdoNetPerformance();
            var database = new DatabaseImpl(ConnectionString);

            Console.WriteLine("Process: " + performance.InstanceName);
            Console.WriteLine();
            Console.WriteLine("Press any key to start ADO.NET performance test...");
            Console.ReadLine();

            var sw = new Stopwatch();
            sw.Start();

            for (int i = 0; i < 500; i++)
            {
                var session = new SessionImpl(database);
                var formTexts = session.FindAll<FormText>();
                session.Dispose();
                Console.Write(".");
            }
            sw.Stop();

            Console.WriteLine();
            Console.WriteLine(sw.ElapsedMilliseconds + " ms");

            performance.DisplayPerformanceCounters();
        }