The timeval structure is used to specify time values. It is associated with the Berkeley Software Distribution (BSD) file Time.h.typedef struct timeval {  
   long tv_sec;  
   long tv_usec;
 } timeval;Members
tv_sec  Time value, in seconds. 
tv_usec Time value, in microseconds.  
msdn上只有这些 ,请问tv-usec和tv-sec分别代表什么?

解决方案 »

  1.   

    tv_sec -----秒
    tv_usec --- 微妙
      

  2.   

    这个结构用来表示一个时间间隔,tv_sec表示秒,tv_usec是毫秒,表示的时间间隔,即两者之和。
      

  3.   

    呵呵,定义一个结构的变量:timeval tv都有错误,不知道怎么用,希望又高手来指点一下.
      

  4.   

    时间间隔的秒和微秒timevval tv会有错?#include <Winsock2.h> 加了么??
      

  5.   

    举例:timeval a;
    a.tv_sec=123;
    a.tv_usec=456;注意包含头文件:
    #include "Winsock2.h"