TIMEVAL structure (winsock.h)

The timeval structure is used to specify a time interval. It is associated with the Berkeley Software Distribution (BSD) Time.h header file.

Syntax

typedef struct timeval {
  long tv_sec;
  long tv_usec;
} TIMEVAL, *PTIMEVAL, *LPTIMEVAL;

Members

tv_sec

Time interval, in seconds.

tv_usec

Time interval, in microseconds. This value is used in combination with the tv_sec member to represent time interval values that are not a multiple of seconds.

Remarks

The timeval structure is used in Windows Sockets by the select function to specify the maximum time the function can take to complete. The time interval is a combination of the values in tv_sec and tv_usec members.

Several functions are added on Windows Vista and later that use the timeval structure. These functions include GetAddrInfoEx, SetAddrInfoEx, WSAConnectByList, and WSAConnectByName.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Header winsock.h (include Winsock2.h)

See also

GetAddrInfoEx

SetAddrInfoEx

WSAConnectByList

WSAConnectByName

linger

select