Skip to content

Commit eb2b3cf

Browse files
MattFromRVAMatt Chaulklin
authored andcommitted
Fixes #2319
1 parent 81a4e55 commit eb2b3cf

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/BenchmarkDotNet/Running/PowerManagementApplier.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ private void ApplyPlanByGuid(Guid guid)
7676
isInitialized = true;
7777
}
7878

79+
Guid ultimatePerformanceGuid = PowerPlansDict[PowerPlan.UltimatePerformance];
80+
Guid highPerformanceGuid = PowerPlansDict[PowerPlan.HighPerformance];
81+
if (userCurrentPowerPlan == ultimatePerformanceGuid && guid == highPerformanceGuid)
82+
{
83+
logger.WriteLineInfo($"Current power plan is already Ultimate Performance. Not changing to High Performance.");
84+
return;
85+
}
86+
7987
if (PowerManagementHelper.Set(guid))
8088
{
8189
powerPlanChanged = true;
@@ -91,4 +99,4 @@ private void ApplyPlanByGuid(Guid guid)
9199
}
92100
}
93101
}
94-
}
102+
}

0 commit comments

Comments
 (0)