参考链接:http://rabbit.eng.miami.edu/info/functions/time.html
原文链接:http://blog.csdn.net/hongwenjun/article/details/7795459
gettimeofday
表头文件:#include <sys/time.h>
函数原型:
int gettimeofday(struct timeval *tv,struct timezone *tz)
函数说明:把目前的时间按tv所指的结构返回,当时地区的信息则放到tz所指的结构中
struct timeval
{
long tv_sec; //秒
long tv_usec;//微妙
}
struct timezone
{
int tz_minuteswest;//和格林威治时间差了多少分钟
int tz_dsttime; //日光节约时间的状态
}
学习代码