Python for Engineers
Solve Problems by Coding Solutions - A Complete solution for python programming
Blog Pages
(Move to ...)
Code
Top 10 Blogs
NumPy Tutorials
Distributions
Self Learning
IDE
Packages
About
▼
Python program to print memory and processor usage
import os import psutil pid = os.getpid() py = psutil.Process(pid) mu = (py.memory_info()[0] / 2.**30) * 1000 print('Memory Use(MB):', mu, 'of process id:', pid) print('CPU Use:',psutil.cpu_percent())
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment