gettimeofday使用

首先系统定义的结构体:

struct timeval 
{ 
time_t tv_sec; // seconds 
suseconds_t tv_usec; // 微妙10-6
};

struct timezone
{
   int tz_minuteswest;//和格林威治时间差了多少分钟
   int tz_dsttime;    //日光节约时间的状态
}

linux系统下的函数:

gettimeofday(struct timeval*,struct timezone*);


posted @ 2012-05-05 10:57  虚无真仙  阅读(38)  评论(0)    收藏  举报