PerformanceTest.Benchmark.PrepareSystemForBenchmark C# (CSharp) Méthode

PrepareSystemForBenchmark() public static méthode

Prepares the system for benchmark will force Garbage Collection to run with maximum generation and wait it to finish.
public static PrepareSystemForBenchmark ( ) : void
Résultat void
        public static void PrepareSystemForBenchmark ()
        {
            GC.Collect (GC.MaxGeneration, GCCollectionMode.Forced);
            GC.WaitForPendingFinalizers ();
            GC.Collect ();
            System.Threading.Thread.Sleep (0);
        }