Created
October 19, 2017 09:37
-
-
Save joonahn/dac360cc519c840150642daae13ac068 to your computer and use it in GitHub Desktop.
CPU usage of one minute per process
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import psutil | |
def monitor_cpu(pid): | |
p = psutil.Process(pid) | |
for i in range(0, 60): | |
print p.cpu_percent(interval=1) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment