Guest User

Untitled

a guest
Jan 4th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. >>> import psutil
  2. >>> # blocking
  3. >>> psutil.cpu_percent(interval=1)
  4. 2.0
  5. >>> # non-blocking (percentage since last call)
  6. >>> psutil.cpu_percent(interval=None)
  7. 2.9
  8. >>> # blocking, per-cpu
  9. >>> psutil.cpu_percent(interval=1, percpu=True)
  10. [2.0, 1.0]
  11.  
  12. >>> import psutil
  13. >>> mem = psutil.virtual_memory()
  14. >>> mem
  15. svmem(total=10367352832, available=6472179712, percent=37.6, used=8186245120, free=2181107712, active=4748992512, inactive=2758115328, buffers=790724608, cached=3500347392, shared=787554304)
Add Comment
Please, Sign In to add comment