Press "Enter" to skip to content

Python program to find out the number of CPUs

Use the multiprocessing module of python to find the number of CPUs. cpu_count() is the function that returns the count of CPUs.

Algorithm

  1. Start
  2. Import multiprocessing module
  3. Use the cpu_count() function provided in the multiprocessing module, it will return the number of CPU
  4. Display the count
  5. End

Program

import multiprocessing
print("CPUs count is : ",multiprocessing.cpu_count())
Freshers Placement

Output

CPUs count is :  4

Comments are closed.