64,683
社区成员
发帖
与我相关
我的任务
分享
#if !defined __NO_ISOCEXT
#include <sys/types.h> /* For useconds_t. */
int __cdecl __MINGW_NOTHROW usleep(useconds_t useconds);
#endif
SYNOPSIS
#include <unistd.h>
unsigned int sleep(unsigned int seconds);
#if defined(WIN32) || defined(WIN64)
#include <windows.h>
#define sleep(n) Sleep(1000 * (n))
#else
#include <unistd.h>
#endif
函数名: sleep
功 能: 执行挂起一段时间
用 法: unsigned sleep(unsigned seconds);
程序例:
#include <dos.h>
#include <stdio.h>
int main(void)
{
int i;
for (i=1; i<5; i++)
{
printf("Sleeping for %d seconds\n", i);
sleep(i);
}
return 0;
}
函数名: sleep
功 能: 执行挂起一段时间
用 法: unsigned sleep(unsigned seconds);
程序例:
#include <dos.h>
#include <stdio.h>
int main(void)
{
int i;
for (i=1; i<5; i++)
{
printf("Sleeping for %d seconds\n", i);
sleep(i);
}
return 0;
}