Trên hệ thống của tôi, man 2 clock_nanosleep
giải thích sự khác biệt giữa hai chức năng như sau:
Like nanosleep(2), clock_nanosleep() allows the caller to sleep for an
interval specified with nanosecond precision. It differs in allowing
the caller to select the clock against which the sleep interval is to
be measured, and in allowing the sleep interval to be specified as
either an absolute or a relative value.
The clock_id argument [...] can have one of the following values:
CLOCK_REALTIME A settable system-wide real-time clock.
CLOCK_MONOTONIC A non-settable, monotonically increasing clock that
measures time since some unspecified point in the past
that does not change after system startup.
CLOCK_PROCESS_CPUTIME_ID
A settable per-process clock that measures CPU time
consumed by all threads in the process.
Xác định "tốt". Xách tay, hiệu quả, nổi tiếng, dễ hiểu, chính xác, cái gì là gì? – unwind
Bạn đã đọc các trang của người đàn ông chưa? http://linux.die.net/man/3/clock_nanosleep –
@SanJacinto không ai đọc trang người đàn ông. Nó giống như tôi hỏi bạn "Bạn đã đọc các điều khoản dịch vụ của Facebook" hay một thợ máy hỏi bạn "Bạn thậm chí đã đọc hướng dẫn sử dụng" chưa, bạn không thể hiểu tại sao dầm cao của bạn sẽ không hoạt động = P – puk