Skip to content

Commit 3437889

Browse files
committed
Fixes dotnet#2319
1 parent d494173 commit 3437889

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/BenchmarkDotNet/Running/PowerManagementApplier.cs

+9-1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ private void ApplyPlanByGuid(Guid guid)
7272
isInitialized = true;
7373
}
7474

75+
Guid ultimatePerformanceGuid = PowerPlansDict[PowerPlan.UltimatePerformance];
76+
Guid highPerformanceGuid = PowerPlansDict[PowerPlan.HighPerformance];
77+
if (userCurrentPowerPlan == ultimatePerformanceGuid && guid == highPerformanceGuid)
78+
{
79+
logger.WriteLineInfo($"Current power plan is already Ultimate Performance. Not changing to High Performance.");
80+
return;
81+
}
82+
7583
if (PowerManagementHelper.Set(guid))
7684
{
7785
powerPlanChanged = true;
@@ -87,4 +95,4 @@ private void ApplyPlanByGuid(Guid guid)
8795
}
8896
}
8997
}
90-
}
98+
}

0 commit comments

Comments
 (0)