Skip to content

Commit

Permalink
Fixes dotnet#2319
Browse files Browse the repository at this point in the history
  • Loading branch information
MattFromRVA committed Dec 15, 2023
1 parent d494173 commit 3437889
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/BenchmarkDotNet/Running/PowerManagementApplier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ private void ApplyPlanByGuid(Guid guid)
isInitialized = true;
}

Guid ultimatePerformanceGuid = PowerPlansDict[PowerPlan.UltimatePerformance];
Guid highPerformanceGuid = PowerPlansDict[PowerPlan.HighPerformance];
if (userCurrentPowerPlan == ultimatePerformanceGuid && guid == highPerformanceGuid)
{
logger.WriteLineInfo($"Current power plan is already Ultimate Performance. Not changing to High Performance.");
return;
}

if (PowerManagementHelper.Set(guid))
{
powerPlanChanged = true;
Expand All @@ -87,4 +95,4 @@ private void ApplyPlanByGuid(Guid guid)
}
}
}
}
}

0 comments on commit 3437889

Please sign in to comment.