c\c++\python
CRISTIANO Xusanduo
这个作者很懒,什么都没留下…
展开
-
统计进程一段时间内的cpu平均负载及最大最小值
使用python统计cpu负载,输出均值,最大最小值,输出到excel中。先用这个脚本在shell中抓取数据,然后保存成文件,喂给python脚本。使用python脚本解析上一步的文件,并计算,写入到excel中。原创 2022-07-26 11:19:18 · 3010 阅读 · 1 评论 -
const*与*const以及const*与*作为函数参数的差别
1.理解const*与*const假设有一个ptr指针,它保存变量vbl的地址。Type* ptr = &vbl;当使用指针的时候就涉及到两个对象:指针本身以及本身所指的对象。这就意味着const有三个层级的保护。1.1. 确保ptr指向唯一的内存有两种写法Type* const ptr = &vbl;Type* const ptr(&vbl);1.2. 确保不能通过ptr改变vbl的值const Type* ptr = &vbl;转载 2022-04-27 11:28:47 · 5974 阅读 · 0 评论 -
warning: format ‘%x‘ expects argument of type ‘unsigned int‘, but argument 6 has type ‘u32
warning: format '%x' expects argument of type 'unsigned int', but argument 6 has type 'u32 {aka volatile long unsigned int}' [-Wformat=]改成长整例如问题原因:LOGI(TAG,"FFT 0x%x\r\n", DATA));修改:LOGI(TAG,"FFT_STATUS_REG 0x%lx\r\n", read.原创 2021-10-29 17:49:15 · 2706 阅读 · 0 评论