你如何使程序睡在C ++在Win 32? [英] How do you make a program sleep in C++ on Win 32?

查看:143
本文介绍了你如何使程序睡在C ++在Win 32?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Win 32上暂停C ++中的程序,以及必须包含哪些库?

How does one "pause" a program in C++ on Win 32, and what libraries must be included?

推荐答案

#include <windows.h>

Sleep(number of milliseconds);

或者如果要在等待另一个程序时暂停程序,请使用 WaitForSingleObject

Or if you want to pause your program while waiting for another program, use WaitForSingleObject.

这篇关于你如何使程序睡在C ++在Win 32?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆