コード例 #1
0
#pragma warning disable 0618
        /// <summary>
        /// Initializes a new instance of the <see cref="HighPerformance"/> class.
        /// </summary>
        internal HighPerformance()
        {
            ////if (!WaitForQuietCpu()) {
            ////    Assert.Inconclusive("Timed out waiting for a quiet CPU in which to perform perf tests.");
            ////}

            this.powerSetting            = new PowerManagment.PowerSetting(PowerManagment.PowerProfiles.HighPerformance);
            this.originalProcessPriority = Process.GetCurrentProcess().PriorityClass;
            Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.High;
            Thread.CurrentThread.Priority = ThreadPriority.Highest;
            SpinCpu();
        }
コード例 #2
0
#pragma warning disable 0618
		/// <summary>
		/// Initializes a new instance of the <see cref="HighPerformance"/> class.
		/// </summary>
		internal HighPerformance() {
			////if (!WaitForQuietCpu()) {
			////    Assert.Inconclusive("Timed out waiting for a quiet CPU in which to perform perf tests.");
			////}

			this.originalLoggerThreshold = LogManager.GetLoggerRepository().Threshold;
			LogManager.GetLoggerRepository().Threshold = LogManager.GetLoggerRepository().LevelMap["OFF"];
			this.powerSetting = new PowerManagment.PowerSetting(PowerManagment.PowerProfiles.HighPerformance);
			this.originalProcessPriority = Process.GetCurrentProcess().PriorityClass;
			Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.High;
			Thread.CurrentThread.Priority = ThreadPriority.Highest;
			SpinCpu();
		}