Python program to find out the number of CPUs

Published by user on

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())

Output

CPUs count is :  4
Categories: python