随笔分类 -  Linux系统

获取程序段执行时间
摘要:struct timeval pre_time, now_time;unsigned int time; gettimeofday(&pre_time, NULL);要测试的程序段gettimeofday(&now_time, NULL); time = (now_time.tv_sec - pre 阅读全文

posted @ 2017-12-17 23:17 Hello-World3 阅读(255) 评论(0) 推荐(0)

Linux开机自启动
摘要:一、rc.local rc.local脚本是一个Linux开机后会自动执行的脚本,我们可以在该脚本内添加命令行指令。该脚本位于/etc/路径下,需要root权限才能修改。 一般讲自己的开机执行脚本放在/etc/init.d/下,然后可在此文件中添加: 这里90表明一个优先级,越高表示执行的越晚。 二 阅读全文

posted @ 2017-10-21 00:37 Hello-World3 阅读(374) 评论(0) 推荐(0)

read()/fread()/mmap()执行效率对比
摘要:一、 read()/fread()/mmap()执行效率对比 系统调用read.c: #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <stdio.h> int 阅读全文

posted @ 2017-08-27 17:55 Hello-World3 阅读(3466) 评论(0) 推荐(0)

时间相关函数
摘要:1.简介 在C中可以使用gettimeofday()来获取时间 2.函数原型 3.说明 gettimeofday()会把目前的时间用tv 结构体返回,当地时区的信息则放到tz所指的结构中timeval 4.相关结构体 struct timeval { long tv_sec;/*秒*/ long t 阅读全文

posted @ 2017-08-07 12:14 Hello-World3 阅读(2598) 评论(0) 推荐(0)

gtk_init()
摘要:#include<stdio.h> #if 0int main(int argc, char *argv[]){ char ***p = &argv; //传参退化成二级指针,对二级指针取地址就是三级指针。 }#endif #if 1void main(){ char *pstr[3] = {"aa 阅读全文

posted @ 2017-07-05 09:29 Hello-World3 阅读(734) 评论(0) 推荐(0)

导航