Browse Source

Update 'README.md'

天问 11 months ago
parent
commit
da92b08a77
1 changed files with 29 additions and 1 deletions
  1. 29 1
      README.md

+ 29 - 1
README.md

@@ -1,3 +1,31 @@
 # psutil
 
-进程(cpu内存,磁盘,传感器,网络)等系统信息,跨平台
+进程(cpu内存,磁盘,传感器,网络)等系统信息,跨平台
+
+## Usage
+
+```
+pip install psutil
+
+# 获取物理cpu核心数
+psutil.cpu_count(logical = False)
+
+psutl.cpu_times()
+
+# 获取CPU使用率
+psutil.cpu_precent(interval-0.5, percpu=True)
+
+# 查看虚拟内存
+psutil.virtual_monery()
+
+# 查看磁盘分区
+psutil.disk_partitions()
+
+# 获取cpu频率
+psutil.cpu_freq()
+
+# 获取系统负载
+pstuil.getloadavg()
+
+
+```