linux下usleep nanosleep select的比较经历

sleep:单位为秒,1秒 usleep:单位为微秒,1/1000 秒 select:单位为微秒,1/1000 000 秒 nanosleep:单位为毫微秒,也就是纳秒,1/1000 000 000 秒 现把比较代码贴出来: #include <stdio.h> #include <stdlib.h> #include <time.h> #include <sys/time.h> #include
相关文章
相关标签/搜索