[quote=引用 7 楼 AAA55567 的回复:] [quote=引用 5 楼 baijiaheizhiganmao 的回复:] [quote=引用 3 楼 buyong 的回复:] write a shell script, use 'top' to find the cpu status. and write to a log.
知道atop -l吧,或者sar也行。
[quote=引用 5 楼 baijiaheizhiganmao 的回复:] [quote=引用 3 楼 buyong 的回复:] write a shell script, use 'top' to find the cpu status. and write to a log.
[quote=引用 3 楼 buyong 的回复:] write a shell script, use 'top' to find the cpu status. and write to a log.
[size=16px]我在本机模拟C/S通信,目前已经实现了服务器向客户端发送命令实现打开,关闭madplay功能。 我的问题是如下: 在客户端上,(1)如何另开一个线程用来监测madplay的CPU占用率,(2)并且周期性的向服务器上报。[/size] 本人是大菜鸟,还望各路高手详尽回复,不胜感激。
1.新开个线程,调用系统api来测试cpu。 2.设置定时器,发送消息。
write a shell script, use 'top' to find the cpu status. and write to a log.
69,382
社区成员
243,073
社区内容
加载中
试试用AI创作助手写篇文章吧