immortalwrt/package/lean/autocore/files/arm
Chuck 2908424223
autocore: optimize the performance of obtaining CPU usage
Preformance Test (on NanoPi R2s, repeat 1000 times):

old command

cpu_usage=$(expr 100 - $(cat /tmp/top_tmp | grep 'CPU:' | awk -F '%' '{print$4}' | awk -F ' ' '{print$2}'))

```
real    0m 14.25s
user    0m 7.96s
sys     0m 20.33s
```

new command

cpu_usage=$(cat /tmp/top_tmp | awk '/^CPU/ { printf("%d%%", 100 - $8) }')

```
real    0m 6.91s
user    0m 4.29s
sys     0m 6.06s
```

Signed-off-by: Chuck <fanck0605@qq.com>
[adjusted for our own tree]
Signed-off-by: CN_SZTL <cnsztl@project-openwrt.eu.org>
2021-02-20 00:23:40 +08:00
..
090-cover-index_files
cpuinfo autocore: optimize the performance of obtaining CPU temperature 2021-02-20 00:06:58 +08:00
rpcd_10_system.js autocore-arm: fix LuCI version display 2021-02-18 19:15:31 +08:00
rpcd_luci autocore: optimize the performance of obtaining CPU usage 2021-02-20 00:23:40 +08:00
rpcd_luci-mod-status.json autocore: merge changes from LuCI 2021-02-09 21:07:19 +08:00