Aspectacular.Test.CoreTests.DynamicPropertyReaderTest.TestDynamicProeprtyReaderPerformance C# (CSharp) Method

TestDynamicProeprtyReaderPerformance() private method

private TestDynamicProeprtyReaderPerformance ( ) : void
return void
        public void TestDynamicProeprtyReaderPerformance()
        {
            string testString = "Hello.";

            const int secondsToRun = 1;

            long runsPerSec = RunCounter.SpinPerSec(secondsToRun*1000, () => testString.GetPropertyValue<int>("Length"));
            long actualRunsPerSec = (long)(runsPerSec/(double)secondsToRun);
            long expectedBaseLine = 2450000;

            this.TestContext.WriteLine("Ran dynamic property accessor {0:#,#0} per second, expected {1:#,#0}.", actualRunsPerSec, expectedBaseLine);
        }
DynamicPropertyReaderTest