功能使程序暂停或睡眠C
Function to make program pause or sleep C++
我正在尝试找到一种方法来暂停或睡觉我的简单C 程序,例如Python中的time.sleep(x)
。C 有等效吗?我想在哪里使用此处的一个示例:
#include <iostream>
using namespace std;
int main() {
for (int x = 0 ; x < 100 ; x++) {
cout << 100 - x << " bottles of beer on the wall, "
<< 100 - x << " bottles of beer!nTake one down pass it around "
<< 100 - (x + 1) << " bottles of beer on the wallnn";
//enter sleep here to pause before next output
}
}
谢谢
您可以从Winapi或Posix usleep(mcrsec)
Sleep(ms)
功能
相关文章:
- LLVM | codegen 用于带有命令行选项的程序输入功能
- 如何用共享库替换可执行C++程序的功能?
- 使用Qt将应用程序的功能拆分为插件
- 暂停功能,它永远循环
- C 程序如果功能中的语句不执行.在逻辑上似乎是错误的
- 无法在 cocos2dx 中实现暂停功能
- 如何使程序使用功能过载用于派生的类对象
- 了解文件页面管理程序的功能
- 当我想扩展当前应用程序的功能时,出现DIAMOND情况
- 如何查找从哪里导入程序C++特定功能
- 暂停功能,并从机器人运动中的某个点开始继续
- 为什么我的程序的功能没有正确发生?
- 功能使程序暂停或睡眠C
- 当Windows XP(32位,SP3)播放声音时,随机应用程序暂停半秒钟
- 使用JAR文件n Visual C 控制台应用程序的功能
- Getline使程序暂停
- 类似于Windows 8下Metro风格应用程序的功能
- QNetworkAccessManager只能通过应用程序主功能工作
- 问如何正确地做一个屏幕保护程序的功能窗口C++
- 暂停功能在Qt使用QTimer按钮按下