![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
使用工具
我要吃欢欢
这个作者很懒,什么都没留下…
展开
-
c语言写一个时间同步
int sync_time(char*ptime) { struct timeval stime; gettimeofday(&stime,NULL);//获取当前时间 struct tm stdiff_time; strptime(ptime,"%Y-%m-%d %H:%M:%S",&stdiff_time); // 将"YYYY-MM-DD hh:mm:ss" 转换为..原创 2021-12-17 15:33:30 · 1521 阅读 · 0 评论 -
检测进程是否运行的方式
进程方式 int check_process(char *pName) { FILE *fp; int result_buf; char temp_cmd[256]; int ret=0; sprintf(temp_cmd, "ps -ef | grep \"%s\" | grep -v \"grep\" | wc -l", pName); fp = popen(temp_cmd, "r"); if (NULL == fp) {原创 2021-12-17 15:12:38 · 683 阅读 · 0 评论