How to determine the hardware (CPU and RAM) on a machine?

前端 未结 13 843
长发绾君心
长发绾君心 2020-12-31 03:29

I\'m working on a cross platform profiling suite, and would like to add information about the machine\'s CPU (architecture/clock speed/cores) and RAM(total) to the report of

相关标签:
13条回答
  • 2020-12-31 04:00

    The CPU is easy. Use the cpuid instruction. I'll leave other posters to find a portable way to determine how much RAM a system has. :-)

    For Linux-specific methods, you can access /proc/meminfo (and /proc/cpuinfo, if you can't be bothered to parse cpuid responses).

    0 讨论(0)
提交回复
热议问题