Skip to content
Discussion options

You must be logged in to vote

Try this:

def test_monitor():
    p = psutil.Process()
    while True:
         print(p.cpu_percent(interval=1))

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by giampaolo
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #691 on November 12, 2026 14:50.