CPU load in a text file. #4122
hawkeyefile
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
It uses the built-in tools from win7 (tested on Win10) onwards, no third party programs needed. Create a .bat file from the code below (I have it in the same folder as the output file "C:\fancontrol-monitors"). This bat will create a file called "cpu.sensor" in the aforementioned directory. It updates every 5 seconds (timeout /t 5) and is accurate down to one decimal place. A load of 1.6% outputs 1.6, a load of 10.2% output 10.2, etc.
This code below is a VBS script, it will run the bat file as a service (no console window will be displayed). You can place it in your startup folder. Not required, however still useful to prevent clutter if you only have one monitor.
I didn't want to use hwinfo64 as it serves little use to me. I design my own sensors that are based on more than just for computers (think entire home automation). I use fancontrol for controlling sprinklers, my stereo, lighting, HVAC, locks, reminders, ammo reloading, etc. Being able to read from a txt file in binary (1 or 0 for on or off) or voltage, or resistance, or capacitance as a plane number value allows fine control. Honestly the trigger function and time average are powerful tools for this.
The openfan controller is your friend for that type of automation. It's output for the fans can be dc controlled without rpm stats (I use a 555 timer to give a false rpm output). you can also feed dc voltage into the pwm pin for monitoring external conditions, then using a trigger in fancontrol to out high or low (12v or 0v, or any value in between). It provides ample current for switching relays or mosfets (you can even perform basic logic functions in the analogue realm this way).
Before this I was using an amiga 1000 and a custom made relay daughter board until 2 years ago.
This started because I only wanted my case fans to go full tilt above 10% cpu utilization. Every temp sensor was too finicky if I was running an ac in my room. If I browse youtube, fans stay on at 30% minimum, playing a video game? 100% full tilt. No obnoxious cycling.
I wish the creator of this software would implement load metrics from perfmon which is invaluable for case fans.
All reactions