What do i need to import to use the sleep function in unix? i know it's windows.h for windows, but what about unix?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
It should be in unistd.h.
Please note that this gives you only a precision of integral seconds.
The most portable way for sub-second precision should be (ab-)using select().
回答2:
#include <unistd.h>
- http://pubs.opengroup.org/onlinepubs/009695399/functions/sleep.html
回答3:
#include <unistd.h>
THe man pages http://cis.kutztown.edu/~frye/cgi-bin/unixManPages.cgi?sleep+3C