Linux?????????????????
???????????? ???????[ 2013/2/27 10:17:02 ] ????????
???????????????Linux?3?????????????4????time_t??struct timeb?? struct timeval??struct timespec??clock_t?? struct tm.
??????1??time_t????????????????????????1970????????????
???????????????<sys/time.h>?У??????? time_t time = time(NULL); ?????
??????2??struct timeb?????????????????????????????????????????????
struct timeb
{
time_t time;
unsigned short millitm;
short timezone;
short dstflag;
};
?????????int ftime(struct timeb *tp);?????timeb??
???????????0????????-1??
??????3??struct timeval?????????????????????????
struct timeval
{
long tv_sec; /* seconds */
long tv_usec; /* microseconds */
};
??????int gettimeofday(struct timeval *tv?? struct timezone *tz);?????
????struct timezone??????????
struct timezone
{
int tz_minuteswest; /* ??Greewich????????????*/
int tz_dsttime; /* ??????????? */
};
??????4??struct timespec??????????????????????????? ???????????????
struct timespec
{
time_t tv_sec; /* seconds */
long tv_nsec; /* nanoseconds */
};
????????????long clock_gettime (clockid_t which_clock?? struct timespec *tp); ???.
???????????????????????tp???????????????6???????????
????CLOCK_REALTIME ?????????1970??1.1??????
????CLOCK_MONOTONIC ???????????????????
????CLOCK_PROCESS_CPUTIME_ID ???????????
????CLOCK_THREAD_CPUTIME_ID ??????????
????CLOCK_REALTIME_HR CLOCK_REALTIME??????汾
????CLOCK_MONOTONIC_HR CLOCK_MONOTONIC??????汾
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11