Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> import psutil
- >>> # blocking
- >>> psutil.cpu_percent(interval=1)
- 2.0
- >>> # non-blocking (percentage since last call)
- >>> psutil.cpu_percent(interval=None)
- 2.9
- >>> # blocking, per-cpu
- >>> psutil.cpu_percent(interval=1, percpu=True)
- [2.0, 1.0]
- >>> import psutil
- >>> mem = psutil.virtual_memory()
- >>> mem
- 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