import
psutil
for
x
in
range
(
3
):
# interval:每隔0.5s刷新一次
# percpu:查看所有的cpu使用率
print
(psutil.cpu_percent(interval
=
0.5
, percpu
True
))