Example #1
0
        static void Main(string[] args)
        {
            if (!Directory.Exists(Environment.CurrentDirectory + "/output"))
            {
                Directory.CreateDirectory(Environment.CurrentDirectory + "/output");
            }
            var benchMark1 = new Framework.BenchmarkTest();

            benchMark1.AddTest("Run Xml Serialization Test Using YAXLib", RunYaxLibXmlSerialization);

            benchMark1.AddTest("Run Xml Serialization Test", RunXmlSerialization);

            benchMark1.AddTest("Run Json Serialization Test", RunJsonSerialization);


            benchMark1.RunTests(100);

            Console.ReadKey();

            var benchMark2 = new Framework.BenchmarkTest();

            benchMark2.AddTest("Run Json Deserialization Test", RunJsonDeserialization);

            benchMark2.AddTest("Run Xml Deserialization Test Using YAXLib", RunYaxLibXmlDeserialization);

            benchMark2.AddTest("Run Xml Deserialization Test", RunXmlDeserialization);

            benchMark2.RunTests(100);
            Console.ReadKey();
        }
Example #2
0
        static void Main(string[] args)
        {
            var benchMark = new Framework.BenchmarkTest("Trasient LifeTime");

            foreach (var useCaseInfo in UseCases)
            {
                UseCaseInfo info = useCaseInfo;
                benchMark.AddTest(useCaseInfo.Name, () => info.UseCase.Run());
            }

            benchMark.RunTests(DefaultIterations);

            var benchMark2 = new Framework.BenchmarkTest("Singleton LifeTime");

            foreach (var useCaseInfo in SingletonUseCases)
            {
                UseCaseInfo info = useCaseInfo;
                benchMark2.AddTest(useCaseInfo.Name, () => info.UseCase.Run());
            }

            benchMark2.RunTests(DefaultIterations);
            Console.ReadKey();
        }