我找不到合适的指南,所以我想问如何在C语言中延迟函数执行。换句话说,在继续执行其他函数之前,程序如何等待一定数量的秒?
例如:
printf("First Function.\n");
//program waits a certain number of seconds before executing next command
printf("Second function executed after certain amount of seconds");
我想知道,我用什么命令可以实现这个?
delay();
顺便说一下,对我来说不起作用。
我必须补充说明,sleep()
也不起作用。
sleep()
。 - Chrissleep
,Windows 上的Sleep
。 - ascheplersleep()
,在 Windows 下使用Sleep()
。您需要阅读目标系统和相关的 API 文档。 - Petersleep()
doesn't work either.*”这句话的意思是什么?请更具体一些!您在哪个平台上遇到了这些问题? - alk