How can I know the seconds and microseconds between 1 January 1970 00:00:00 and now using timeval? Thanks.
struct timeval {
long tv_sec; /*seconds since 1/1/1970*/
long tv_usec; /*microseconds since tv_sec*/
};
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
you call
gettimeofday()However
gettimeofday()is obsolete, the manual is recommending clock_gettime(2) instead: