Linux时间操作(time、gettimeofday)
一、time函数 #include <time.h> time_t time (time_t *calptr); 返回距计算机元年的秒数 一旦取得这种以秒计的很大的时间值后,通常要调用另一个时间函数将其变换为人们可读的时间和日期 #include <time.h> //calendar time into a broken-down time expressed as UTC struct tm * gmtime (const time_t *calptr); //converts the calendar time to the local time , taking into account the local time zone and //daylight saving time flag struct tm * localtime (const time_t *calptr); //converts it into a time_t value time_t mktime (struct tm *tmptr); struct tm { /* a broken-down time */ int tm_sec; /* seconds after the minute: [0 - 60] */ int tm_min; /* minutes after the hour: [0