コード例 #1
0
        public static void Run()
        {
#if DEBUG
            var runner = new CachedFunctionWithEnumerableKeys();

            runner.OneHit();
            runner.OneMiss();
            runner.OneHitAndOneMiss();
            runner.OneHundredHits();
            runner.OneHundredMisses();
            runner.OneHundredHitsAndOneHundredMisses();
#else
            BenchmarkRunner.Run <CachedFunctionWithEnumerableKeys>(ManualConfig
                                                                   .Create(DefaultConfig.Instance)
                                                                   .With(Job.MediumRun.WithLaunchCount(1))
                                                                   .With(MemoryDiagnoser.Default));
#endif
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: hpeebles/CacheMeIfYouCan
        static void Main(string[] args)
        {
            var benchmarkId = GetBenchmarkId(args);

            switch (benchmarkId)
            {
            case 0:
                CachedFunctionWithSingleKey.Run();
                break;

            case 1:
                CachedFunctionWithEnumerableKeys.Run();
                break;

            case 2:
                LocalCaches.Run();
                break;

            default:
                Console.WriteLine("No benchmarks found with Id - " + benchmarkId);
                break;
            }
        }