Linux?????????????????
???????????? ???????[ 2013/2/27 10:17:02 ] ????????
????????????????侫???
????long clock_getres(clockid_t );
??????????????????
????long clock_settime(clockid_t ??struct timespec*);
????????time?????????????????????ж??????????????left_time???????????
????long clock_nanosleep(clockid_t ??int flag??timespec* time??timespec* left_time);
??????5??clock_t????? ??clock_t clock(); ??????.
???????????????cpu???. ????????.
??????6??struct tm???????????????????????
struct tm
{
int tm_sec; /* seconds */
int tm_min; /* minutes */
int tm_hour; /* hours */
int tm_mday; /* day of the month */
int tm_mon; /* month */
int tm_year; /* year */
int tm_wday; /* day of the week */
int tm_yday; /* day in the year */
int tm_isdst; /* daylight saving time */
};
struct tm* gmtime(const time_t *timep);
struct tm* localtime(const time_t *timep);
time_t mktime(struct tm *tm);
????gmtime??localtime?????????????????????????????????????????α?????????????????
???????????????????????????????? ???????????汾?? ???????_r??汾 -- gmtime_r?? localtime_r?? mktime_r.
??????????????
????????????????У?sleep()??usleep()??nanosleep()??select()??pselect().
unsigned int sleep(unsigned int seconds);
void usleep(unsigned long usec);
int nanosleep(const struct timespec *req?? struct timespec *rem);
int select(int n?? fd_set *readfds?? fd_set *writefds?? fd_set *exceptfds??struct timeval *timeout);
int pselect(int n?? fd_set *readfds?? fd_set *writefds?? fd_set *exceptfds?? const struct timespec *timeout?? const sigset_t *sigmask);
????alarm?????????????????????????????????????
?????????????????????????????????2?sleep????????????usleep/select?????????????nanosleep??pselect??????????????
?????????????У?linux???nanosleep??alarm???????????????????????????linux??????????????????????????????man nanosleep????????????????man?????????????Linux/i386????10 ms ??Linux/Alpha????1ms??
??????
???·???
??????????????????
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