I've been wanting a way to figure out how many P-cores and E-cores there are on the newer Intel CPUs.
So I think I have it figured out. I put together a quick skin to test the idea, and show you.
Also, I am hoping you all can review the code and if there are better ways to get this answer, I am willing to hear it.
You can get to the numbers of Cores and number of Logical processors in Windows, but not the actual P-core of E-core count. Not without using 3rd party tools. I wanted to keep this native. So I am using the wmic windows command to get that. Is there a better way?
And then I use those 2 numbers to calculate the P-cores and E-cores.
As best I can tell, I think this should work on all CPUs. If you don't have E-cores, it will just be 0.
I'll post the code here and you can look it over. Or use it if you have a need for it.
Here are 2 examples. One with E-cores and one without.
i7-1370P i9-9900K
Code: Select all
[Rainmeter]
Update=1000
BackgroundMargins=0,0,0,0
OnRefreshAction=[!CommandMeasure CpuCores "Run"][!CommandMeasure CpuLogical "Run"]
[Metadata]
Name=CPUtest
Author=TGonZo
Information=Calculate P-cores and E-cores
License=Creative Commons BY-NC-SA 3.0
Version=1.0.0
[Variables]
fontName=Trebuchet MS
textSize=12
;=========================================================
[meterBase]
Meter=Image
X=0
Y=0
W=160
H=140
SolidColor=47,47,47,240
UpdateDivider=-1
;-------------
[CpuCores]
Measure=Plugin
Plugin=RunCommand
Parameter=wmic cpu get NumberOfCores/Format:List
OutputType=ANSI
RegExpSubstitute=1
Substitute="(?siU)^.*NumberOfCores=([\d]{1,2})":"\1","#CRLF#":""
UpdateDivider=-1
[CpuLogical]
Measure=Plugin
Plugin=RunCommand
Parameter=wmic cpu get NumberOfLogicalProcessors/Format:List
OutputType=ANSI
RegExpSubstitute=1
Substitute="(?siU)^.*NumberOfLogicalProcessors=([\d]{1,2})":"\1","#CRLF#":""
UpdateDivider=-1
[CpuPcores]
Measure=Calc
Formula=([CpuLogical]-[CpuCores] = 0 ? [CpuCores] : [CpuLogical]-[CpuCores])
DynamicVariables=1
[CpuEcores]
Measure=Calc
Formula=[CpuCores]-CpuPcores
DynamicVariables=1
[CpuFirstEcore]
Measure=Calc
Formula=(CpuEcores = 0 ? 0 : [CpuLogical]-CpuEcores+1)
DynamicVariables=1
;-------------
[MeterCPUs]
Meter=String
MeasureName=CpuCores
MeasureName2=CpuLogical
MeasureName3=CpuPcores
MeasureName4=CpuEcores
MeasureName5=CpuFirstEcore
FontSize=13
FontColor=255,255,255,255
Padding=10,10,10,10
AntiAlias=1
Text=Cores = %1 #CRLF#Logicals = %2 #CRLF#-----------------#CRLF#P-cores = %3 #CRLF#E-cores = %4 #CRLF#1st E-core = %5
Let me know what you think.