Switch to the dark side!

Rainmeter

Latest Discussion
5 months ago
5 months ago
5 months ago
5 months ago
More...

Post a new topic



How to return the total number of cores?

Avatar-50x50
Xevailo says:

Hello everyone :)

I am trying to write a multicore-CPU Plugin that shows a measure for each core available. The problem is that I can't find a way to display the total nuber of cores. If I use

[MeasureCPU9]
Measure=CPU
Processor=9

with an Octacore-CPU, Measure 9 is always the average CPU usage. My plan was to use a if-then statement like this for every core:

IfBelowValue="total_cores" < N
IfBelowAction=!SetVariableGroup Hidden 1 CoreN

Of course, I'd replace N with the number of each core, and assign

Group=CoreN
Hidden=0

to every item used in the script. The question is if there is a way to get a value for my imaginary "total_cores" variable.

Thanks in advance,

Xevailo

08:51 am, Tuesday, February 25, 2014 (4 months ago)
Avatar-50x50
killall-q says:

Lua can read environment variables.

CoreCount = tonumber(os.getenv("NUMBER_OF_PROCESSORS"))

12:17 pm (2 weeks ago)
 

Reply to this topic

You must register and become a member to post a reply.