The definition of struct timeval
is present in time.h
so you hadt to include this header;
#include <sys/time.h> //you don't include this header
// time.h
struct timeval {
time_t tv_sec; // Number of whole seconds of elapsed time
long int tv_usec; // Number of microseconds of rest of elapsed time minus tv_sec. Always less than one million
};
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…