systeminformation
systeminformation copied to clipboard
Feature Request: Current Cpu Frequency/Clock Speed Support on Apple Silicon
Is your feature request related to a problem? Please describe. This request regards issue #564.
Describe the solution you'd like
The ability for the cpuCurrentSpeed()
function to actually retrieve the current CPU frequency/clock speed on MacOS (Apple Silicon and x86).
I have managed to develop a Objective-C script that can pull this information (which was nearly impossible to figure out). I have compiled a binary for it as well, and I thought it would be cool if systeminformation could utilize that binary by calling it from the exec
function in the child_process
module.
Though, in doing this, systeminformation would have to bundle the binary within its source, which could cause complications for Electron users; but, having the ability to pull the current clock speeds from the CPU (per core) on Apple Silicon and Intel is an unseen ability for an app, and I think that ability would make systeminformation even better than it already is.
Describe alternatives you've considered
I currently don't know any alternative ways to do this. The code uses inline assembly to measure cycles, and (to my knowledge) there is no inline assembly in node. The best way of implementation is to use my binary and the exec
command as explained above.
Good day! 👍
2022 Update
The script now supports getting the CPU current frequency (per core, per cluster, and the package) on Apple Silicon (M1 Fully Supported, M1 Pro/Max unofficial) and Intel CPUs (Ivy Bridge and Newer, excluding most Xeons).