开发者

sleep function in c, unix

开发者 https://www.devze.com 2023-02-11 15:59 出处:网络
What do i need to import to use the sleep function in unix? i know it\'s windows.h for windows, but what abou开发者_Go百科t unix?It should be in unistd.h.

What do i need to import to use the sleep function in unix? i know it's windows.h for windows, but what abou开发者_Go百科t unix?


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().


#include <unistd.h>
  • http://pubs.opengroup.org/onlinepubs/009695399/functions/sleep.html


#include <unistd.h>

THe man pages http://cis.kutztown.edu/~frye/cgi-bin/unixManPages.cgi?sleep+3C

0

精彩评论

暂无评论...
验证码 换一张
取 消