????????????????侫???

????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??